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

Side by Side Diff: chrome/browser/downgrade/user_data_downgrade_browsertest.cc

Issue 2692843002: Fail tests fast if overriding the Windows registry fails. (Closed)
Patch Set: sync to position 450085 Created 3 years, 10 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/downgrade/user_data_downgrade.h" 5 #include "chrome/browser/downgrade/user_data_downgrade.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "base/test/test_reg_util_win.h" 10 #include "base/test/test_reg_util_win.h"
11 #include "base/version.h" 11 #include "base/version.h"
12 #include "base/win/registry.h" 12 #include "base/win/registry.h"
13 #include "chrome/common/chrome_constants.h" 13 #include "chrome/common/chrome_constants.h"
14 #include "chrome/common/chrome_paths.h" 14 #include "chrome/common/chrome_paths.h"
15 #include "chrome/installer/util/browser_distribution.h" 15 #include "chrome/installer/util/browser_distribution.h"
16 #include "chrome/installer/util/google_update_constants.h" 16 #include "chrome/installer/util/google_update_constants.h"
17 #include "chrome/test/base/in_process_browser_test.h" 17 #include "chrome/test/base/in_process_browser_test.h"
18 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
19 19
20 namespace downgrade { 20 namespace downgrade {
21 21
22 class UserDataDowngradeBrowserTestBase : public InProcessBrowserTest { 22 class UserDataDowngradeBrowserTestBase : public InProcessBrowserTest {
23 protected: 23 protected:
24 // content::BrowserTestBase: 24 // content::BrowserTestBase:
25 void SetUpInProcessBrowserTestFixture() override { 25 void SetUpInProcessBrowserTestFixture() override {
26 HKEY root = HKEY_CURRENT_USER; 26 HKEY root = HKEY_CURRENT_USER;
27 registry_override_manager_.OverrideRegistry(root); 27 ASSERT_NO_FATAL_FAILURE(registry_override_manager_.OverrideRegistry(root));
28 key_.Create(root, 28 key_.Create(root,
29 BrowserDistribution::GetDistribution()->GetStateKey().c_str(), 29 BrowserDistribution::GetDistribution()->GetStateKey().c_str(),
30 KEY_SET_VALUE | KEY_WOW64_32KEY); 30 KEY_SET_VALUE | KEY_WOW64_32KEY);
31 } 31 }
32 32
33 // InProcessBrowserTest: 33 // InProcessBrowserTest:
34 bool SetUpUserDataDirectory() override { 34 bool SetUpUserDataDirectory() override {
35 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_)) 35 if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir_))
36 return false; 36 return false;
37 if (!CreateTemporaryFileInDir(user_data_dir_, &other_file_)) 37 if (!CreateTemporaryFileInDir(user_data_dir_, &other_file_))
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 ASSERT_TRUE(base::PathExists(other_file_)); 125 ASSERT_TRUE(base::PathExists(other_file_));
126 } 126 }
127 127
128 // Verify the "Last Version" file won't be created for non-msi install. 128 // Verify the "Last Version" file won't be created for non-msi install.
129 IN_PROC_BROWSER_TEST_F(UserDataDowngradeBrowserNoMSITest, Test) { 129 IN_PROC_BROWSER_TEST_F(UserDataDowngradeBrowserNoMSITest, Test) {
130 ASSERT_FALSE(base::PathExists(last_version_file_path_)); 130 ASSERT_FALSE(base::PathExists(last_version_file_path_));
131 ASSERT_TRUE(base::PathExists(other_file_)); 131 ASSERT_TRUE(base::PathExists(other_file_));
132 } 132 }
133 133
134 } // namespace downgrade 134 } // namespace downgrade
OLDNEW
« no previous file with comments | « base/test/test_reg_util_win_unittest.cc ('k') | chrome/browser/extensions/api/messaging/native_messaging_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698