henrika | 3ca48a6 | 2018-05-21 13:34:51 +0200 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #include "rtc_base/win/windows_version.h" |
| 12 | |
| 13 | #include "rtc_base/gunit.h" |
| 14 | #include "rtc_base/logging.h" |
| 15 | |
| 16 | namespace rtc { |
| 17 | namespace rtc_win { |
| 18 | namespace { |
| 19 | |
| 20 | void MethodSupportedOnWin10AndLater() { |
| 21 | RTC_DLOG(INFO) << "MethodSupportedOnWin10AndLater"; |
| 22 | } |
| 23 | |
| 24 | void MethodNotSupportedOnWin10AndLater() { |
| 25 | RTC_DLOG(INFO) << "MethodNotSupportedOnWin10AndLater"; |
| 26 | } |
| 27 | |
| 28 | // Use global GetVersion() and use it in a way a user would typically use it |
| 29 | // when checking for support of a certain API: |
| 30 | // "if (rtc_win::GetVersion() < VERSION_WIN10) ...". |
| 31 | TEST(WindowsVersion, GetVersionGlobalScopeAccessor) { |
| 32 | if (GetVersion() < VERSION_WIN10) { |
| 33 | MethodNotSupportedOnWin10AndLater(); |
| 34 | } else { |
| 35 | MethodSupportedOnWin10AndLater(); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | TEST(WindowsVersion, ProcessorModelName) { |
| 40 | std::string name = OSInfo::GetInstance()->processor_model_name(); |
| 41 | EXPECT_FALSE(name.empty()); |
| 42 | RTC_DLOG(INFO) << "processor_model_name: " << name; |
| 43 | } |
| 44 | |
| 45 | } // namespace |
| 46 | } // namespace rtc_win |
| 47 | } // namespace rtc |