Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: chrome_elf/chrome_elf_util_unittest.cc

Issue 2183263003: [chrome_elf] Big ELF cleanup. Part 1. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update with latest trunk. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome_elf/chrome_elf_security.cc ('k') | chrome_elf/crash/crash_helper.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome_elf/chrome_elf_security.cc ('k') | chrome_elf/crash/crash_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698