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

Side by Side Diff: chrome/installer/util/product_unittest.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 (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 "chrome/installer/util/product.h" 5 #include "chrome/installer/util/product.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 28 matching lines...) Expand all
39 base::FilePath program_files; 39 base::FilePath program_files;
40 ASSERT_TRUE(PathService::Get(base::DIR_PROGRAM_FILES, &program_files)); 40 ASSERT_TRUE(PathService::Get(base::DIR_PROGRAM_FILES, &program_files));
41 // The User Data path should never be under program files, even though 41 // The User Data path should never be under program files, even though
42 // system_level is true. 42 // system_level is true.
43 EXPECT_EQ(std::wstring::npos, 43 EXPECT_EQ(std::wstring::npos,
44 user_data_dir.value().find(program_files.value())); 44 user_data_dir.value().find(program_files.value()));
45 45
46 HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 46 HKEY root = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
47 { 47 {
48 RegistryOverrideManager override_manager; 48 RegistryOverrideManager override_manager;
49 override_manager.OverrideRegistry(root); 49 ASSERT_NO_FATAL_FAILURE(override_manager.OverrideRegistry(root));
50 50
51 // There should be no installed version in the registry. 51 // There should be no installed version in the registry.
52 machine_state.Initialize(); 52 machine_state.Initialize();
53 EXPECT_EQ(nullptr, machine_state.GetProductState(system_level)); 53 EXPECT_EQ(nullptr, machine_state.GetProductState(system_level));
54 54
55 // Let's pretend chrome is installed. 55 // Let's pretend chrome is installed.
56 RegKey version_key(root, distribution->GetVersionKey().c_str(), 56 RegKey version_key(root, distribution->GetVersionKey().c_str(),
57 KEY_ALL_ACCESS); 57 KEY_ALL_ACCESS);
58 ASSERT_TRUE(version_key.Valid()); 58 ASSERT_TRUE(version_key.Valid());
59 59
(...skipping 27 matching lines...) Expand all
87 if (chrome_state) 87 if (chrome_state)
88 EXPECT_TRUE(chrome_state->is_msi()); 88 EXPECT_TRUE(chrome_state->is_msi());
89 } 89 }
90 } 90 }
91 91
92 TEST(ProductTest, LaunchChrome) { 92 TEST(ProductTest, LaunchChrome) {
93 // TODO(tommi): Test Product::LaunchChrome and 93 // TODO(tommi): Test Product::LaunchChrome and
94 // Product::LaunchChromeAndWait. 94 // Product::LaunchChromeAndWait.
95 NOTIMPLEMENTED(); 95 NOTIMPLEMENTED();
96 } 96 }
OLDNEW
« no previous file with comments | « chrome/installer/util/product_state_unittest.cc ('k') | chrome/installer/util/scoped_user_protocol_entry_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698