diff options
author | scottmg <scottmg@chromium.org> | 2016-03-11 16:07:17 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-03-12 00:08:42 +0000 |
commit | d68b1e1c89ab3d8055046883b1bf726084673959 (patch) | |
tree | b22f641050892f4e62cd64dfffab87115e7b2efc /base/win/windows_version_unittest.cc | |
parent | 34c351416a102e4ee510badb86fbc4f57604ccd0 (diff) | |
download | chromium_src-d68b1e1c89ab3d8055046883b1bf726084673959.zip chromium_src-d68b1e1c89ab3d8055046883b1bf726084673959.tar.gz chromium_src-d68b1e1c89ab3d8055046883b1bf726084673959.tar.bz2 |
Add histograms to compare GetVersionEx() with VerQueryValue() of kernel32
Checking VerQueryValue() of kernel32 reports the "real" OS, rather than
the potentially shimmed one that GetVersionEx() reports.
Normally it's better to use GetVersionEx() because that'll determine the
APIs that are available and how they behave. However, we'd like to know
if there are a substantial percentage of users in compatibility mode, as
there have been complaints of users seeing the "XP and Vista are no
longer supported" infobar on Windows 7.
R=asvitkine@chromium.org, robliao@chromium.org, wfh@chromium.org, nick@chromium.org
BUG=581499
Review URL: https://codereview.chromium.org/1784623003
Cr-Commit-Position: refs/heads/master@{#380793}
Diffstat (limited to 'base/win/windows_version_unittest.cc')
-rw-r--r-- | base/win/windows_version_unittest.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/base/win/windows_version_unittest.cc b/base/win/windows_version_unittest.cc new file mode 100644 index 0000000..f0d6d96 --- /dev/null +++ b/base/win/windows_version_unittest.cc @@ -0,0 +1,22 @@ +// Copyright 2016 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "base/win/windows_version.h" + +#include "testing/gtest/include/gtest/gtest.h" + +namespace base { +namespace win { +namespace { + +TEST(WindowsVersion, GetVersionExAndKernelVersionMatch) { + // If this fails, we're running in compatibility mode, or need to update the + // application manifest. + EXPECT_EQ(OSInfo::GetInstance()->version(), + OSInfo::GetInstance()->Kernel32Version()); +} + +} // namespace +} // namespace win +} // namespace base |