diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-07 22:15:34 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-07 22:15:34 +0000 |
commit | f4812211951630ac47b96a1b7b78f3a3dcc2b9b9 (patch) | |
tree | 68db135c222a25e8a158bdff620624aa1d75ec34 /sandbox/src/dep_test.cc | |
parent | 42e5c865f8702de0cd9e24726fe9bf69cb5cae9c (diff) | |
download | chromium_src-f4812211951630ac47b96a1b7b78f3a3dcc2b9b9.zip chromium_src-f4812211951630ac47b96a1b7b78f3a3dcc2b9b9.tar.gz chromium_src-f4812211951630ac47b96a1b7b78f3a3dcc2b9b9.tar.bz2 |
Make the windows_version.h functions threadsafe by using a singleton. Add accessors to the singleton for more values that various code wants, then convert almost everyone using OSVERSIONINFO or SYSTEM_INFO structs to calling these accessors. Declare an AtExitManager in the out-of-process test runner since it didn't have one and that breaks singleton-using code in the test executable (as opposed to in chrome.dll).
A few other minor cleanups along the way (binding of "*", shorter code, etc.). Because I ran into problems with it while modifying gcapi.cc, I cleaned up our usage of strsafe.h a bit, so that files that don't need it don't include it and files that do use STRSAFE_NO_DEPRECATE instead of a modified #include order.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6816027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sandbox/src/dep_test.cc')
-rw-r--r-- | sandbox/src/dep_test.cc | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/sandbox/src/dep_test.cc b/sandbox/src/dep_test.cc index 7d57c6e..91d4e67 100644 --- a/sandbox/src/dep_test.cc +++ b/sandbox/src/dep_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -12,32 +12,6 @@ namespace sandbox { namespace { -class DepTest : public testing::Test { - public: - static bool IsTestCaseDisabled() { - OSVERSIONINFOEX version_info; - version_info.dwOSVersionInfoSize = sizeof version_info; - GetVersionEx(reinterpret_cast<OSVERSIONINFO*>(&version_info)); - - // Windows 2000 doesn't support DEP at all. - if (version_info.dwMajorVersion == 5 && version_info.dwMinorVersion == 0) - return true; - - // Windows XP Service Pack 0 and 1 don't support DEP at all. - if (version_info.dwMajorVersion == 5 && version_info.dwMinorVersion == 1 - && version_info.wServicePackMajor < 2) - return true; - - // Bug 1212371 Vista SP0 DEP support is half-baked. Nobody seem to have - // noticed! - if (version_info.dwMajorVersion == 6 && - version_info.wServicePackMajor == 0) - return true; - - return false; - } -}; - BYTE kReturnCode[] = { // ret 0xC3, @@ -167,7 +141,7 @@ SBOX_TESTS_COMMAND int CheckDepLevel(int argc, wchar_t **argv) { } // namespace // This test is disabled. See bug 1275842 -TEST_F(DepTest, DISABLED_TestDepDisable) { +TEST(DepTest, DISABLED_TestDepDisable) { TestRunner runner(JOB_UNPROTECTED, USER_INTERACTIVE, USER_INTERACTIVE); runner.SetTimeout(INFINITE); |