| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <tuple> | 5 #include <tuple> |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #include <versionhelpers.h> // windows.h must be before. | 7 #include <versionhelpers.h> // windows.h must be before. |
| 8 | 8 |
| 9 #include "base/test/test_reg_util_win.h" | 9 #include "base/test/test_reg_util_win.h" |
| 10 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 TEST(ChromeElfUtilTest, BrowserProcessSecurityTest) { | 105 TEST(ChromeElfUtilTest, BrowserProcessSecurityTest) { |
| 106 if (!::IsWindows8OrGreater()) | 106 if (!::IsWindows8OrGreater()) |
| 107 return; | 107 return; |
| 108 | 108 |
| 109 // Set up registry override for this test. | 109 // Set up registry override for this test. |
| 110 registry_util::RegistryOverrideManager override_manager; | 110 registry_util::RegistryOverrideManager override_manager; |
| 111 RegRedirect(nt::HKCU, override_manager); | 111 RegRedirect(nt::HKCU, override_manager); |
| 112 | 112 |
| 113 // First, ensure that the emergency-off finch signal works. | 113 // First, ensure that the emergency-off finch signal works. |
| 114 EXPECT_TRUE(SetSecurityFinchFlag(true)); | 114 EXPECT_TRUE(SetSecurityFinchFlag(true)); |
| 115 EarlyBrowserSecurity(); | 115 elf_security::EarlyBrowserSecurity(); |
| 116 EXPECT_FALSE(IsSecuritySet()); | 116 EXPECT_FALSE(IsSecuritySet()); |
| 117 EXPECT_TRUE(SetSecurityFinchFlag(false)); | 117 EXPECT_TRUE(SetSecurityFinchFlag(false)); |
| 118 | 118 |
| 119 // Second, test that the process mitigation is set when no finch signal. | 119 // Second, test that the process mitigation is set when no finch signal. |
| 120 EarlyBrowserSecurity(); | 120 elf_security::EarlyBrowserSecurity(); |
| 121 EXPECT_TRUE(IsSecuritySet()); | 121 EXPECT_TRUE(IsSecuritySet()); |
| 122 } | 122 } |
| 123 | 123 |
| 124 //------------------------------------------------------------------------------ | 124 //------------------------------------------------------------------------------ |
| 125 // NT registry API tests (chrome_elf_reg) | 125 // NT registry API tests (chrome_elf_reg) |
| 126 //------------------------------------------------------------------------------ | 126 //------------------------------------------------------------------------------ |
| 127 | 127 |
| 128 TEST(ChromeElfUtilTest, NTRegistry) { | 128 TEST(ChromeElfUtilTest, NTRegistry) { |
| 129 HANDLE key_handle; | 129 HANDLE key_handle; |
| 130 const wchar_t* dword_val_name = L"DwordTestValue"; | 130 const wchar_t* dword_val_name = L"DwordTestValue"; |
| (...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 testing::Combine(testing::Values("canary"), | 586 testing::Combine(testing::Values("canary"), |
| 587 testing::Values("user"), | 587 testing::Values("user"), |
| 588 testing::Values("single"))); | 588 testing::Values("single"))); |
| 589 INSTANTIATE_TEST_CASE_P(GoogleChrome, | 589 INSTANTIATE_TEST_CASE_P(GoogleChrome, |
| 590 ChromeElfUtilTest, | 590 ChromeElfUtilTest, |
| 591 testing::Combine(testing::Values("google"), | 591 testing::Combine(testing::Values("google"), |
| 592 testing::Values("user", "system"), | 592 testing::Values("user", "system"), |
| 593 testing::Values("single", "multi"))); | 593 testing::Values("single", "multi"))); |
| 594 | 594 |
| 595 } // namespace | 595 } // namespace |
| OLD | NEW |