OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_version_info.h" | 5 #include "base/file_version_info.h" |
6 #include "base/file_version_info_win.h" | 6 #include "base/file_version_info_win.h" |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 base::FilePath path = GetIETemporaryFilesFolder(); | 27 base::FilePath path = GetIETemporaryFilesFolder(); |
28 EXPECT_FALSE(path.empty()); | 28 EXPECT_FALSE(path.empty()); |
29 } | 29 } |
30 | 30 |
31 class UtilTests : public testing::Test { | 31 class UtilTests : public testing::Test { |
32 protected: | 32 protected: |
33 void SetUp() { | 33 void SetUp() { |
34 DeleteAllSingletons(); | 34 DeleteAllSingletons(); |
35 } | 35 } |
36 | 36 |
37 void TearDown() { | |
38 registry_virtualization_.RemoveAllOverrides(); | |
39 } | |
40 | |
41 // This is used to manage life cycle of PolicySettings singleton. | 37 // This is used to manage life cycle of PolicySettings singleton. |
42 // base::ShadowingAtExitManager at_exit_manager_; | 38 // base::ShadowingAtExitManager at_exit_manager_; |
43 chrome_frame_test::ScopedVirtualizeHklmAndHkcu registry_virtualization_; | 39 chrome_frame_test::ScopedVirtualizeHklmAndHkcu registry_virtualization_; |
44 }; | 40 }; |
45 | 41 |
46 TEST_F(UtilTests, GetModuleVersionTest) { | 42 TEST_F(UtilTests, GetModuleVersionTest) { |
47 HMODULE mod = GetModuleHandle(L"kernel32.dll"); | 43 HMODULE mod = GetModuleHandle(L"kernel32.dll"); |
48 EXPECT_NE(mod, static_cast<HMODULE>(NULL)); | 44 EXPECT_NE(mod, static_cast<HMODULE>(NULL)); |
49 wchar_t path[MAX_PATH] = {0}; | 45 wchar_t path[MAX_PATH] = {0}; |
50 GetModuleFileName(mod, path, arraysize(path)); | 46 GetModuleFileName(mod, path, arraysize(path)); |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 | 542 |
547 ASSERT_EQ(expect_match, | 543 ASSERT_EQ(expect_match, |
548 CheckXUaCompatibleDirective(test.header_value, | 544 CheckXUaCompatibleDirective(test.header_value, |
549 all_versions[version_index])) | 545 all_versions[version_index])) |
550 << "Expect '" << test.header_value << "' to " | 546 << "Expect '" << test.header_value << "' to " |
551 << (expect_match ? "match" : "not match") << " IE major version " | 547 << (expect_match ? "match" : "not match") << " IE major version " |
552 << all_versions[version_index]; | 548 << all_versions[version_index]; |
553 } | 549 } |
554 } | 550 } |
555 } | 551 } |
OLD | NEW |