blob: e1cd920157a0ec855a61979b983b14f6456382a7 [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() {
Harald Alvestrand97597c02021-11-04 12:01:23 +000021 RTC_DLOG(LS_INFO) << "MethodSupportedOnWin10AndLater";
henrika3ca48a62018-05-21 13:34:51 +020022}
23
24void MethodNotSupportedOnWin10AndLater() {
Harald Alvestrand97597c02021-11-04 12:01:23 +000025 RTC_DLOG(LS_INFO) << "MethodNotSupportedOnWin10AndLater";
henrika3ca48a62018-05-21 13:34:51 +020026}
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());
Harald Alvestrand97597c02021-11-04 12:01:23 +000042 RTC_DLOG(LS_INFO) << "processor_model_name: " << name;
henrika3ca48a62018-05-21 13:34:51 +020043}
44
45} // namespace
46} // namespace rtc_win
47} // namespace rtc