blob: 9e582e549f95e397594aba898cd8a95356dc74d8 [file] [log] [blame]
henrika3ca48a62018-05-21 13:34:51 +02001/*
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
16namespace rtc {
17namespace rtc_win {
18namespace {
19
20void MethodSupportedOnWin10AndLater() {
21 RTC_DLOG(INFO) << "MethodSupportedOnWin10AndLater";
22}
23
24void 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) ...".
31TEST(WindowsVersion, GetVersionGlobalScopeAccessor) {
32 if (GetVersion() < VERSION_WIN10) {
33 MethodNotSupportedOnWin10AndLater();
34 } else {
35 MethodSupportedOnWin10AndLater();
36 }
37}
38
39TEST(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