Commit 43160106 authored by ckocagil's avatar ckocagil Committed by Commit bot

Revert of Fix ProductTest.ProductInstallBasic and...

Revert of Fix ProductTest.ProductInstallBasic and InstallerStateTest.InitializeTwice flakes. (patchset #4 id:80001 of https://codereview.chromium.org/521703002/)

Reason for revert:
Breaks InstallerStateTest.InitializeTwice on XP:
http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%281%29/builds/32481

Original issue's description:
> Fix ProductTest.ProductInstallBasic and InstallerStateTest.InitializeTwice flakes.
>
> Use registry virtualization so that stale data on the test machines
> don't interfere with the tests.
>
> BUG=375739
>
> Committed: https://chromium.googlesource.com/chromium/src/+/6d6ac988d6a7a311876f3b0d0257086ac58c8181

TBR=robertshield@chromium.org,grt@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=375739

Review URL: https://codereview.chromium.org/520863005

Cr-Commit-Position: refs/heads/master@{#292812}
parent 223e45cd
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/path_service.h" #include "base/path_service.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_path_override.h"
#include "base/test/test_reg_util_win.h" #include "base/test/test_reg_util_win.h"
#include "base/version.h" #include "base/version.h"
#include "base/win/registry.h" #include "base/win/registry.h"
...@@ -604,19 +603,6 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { ...@@ -604,19 +603,6 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) {
} }
TEST_F(InstallerStateTest, InitializeTwice) { TEST_F(InstallerStateTest, InitializeTwice) {
// Override these paths so that they can be found after the registry override
// manager is in place.
base::FilePath temp;
PathService::Get(base::DIR_PROGRAM_FILES, &temp);
base::ScopedPathOverride program_files_override(base::DIR_PROGRAM_FILES,
temp);
PathService::Get(base::DIR_PROGRAM_FILESX86, &temp);
base::ScopedPathOverride program_filesx86_override(base::DIR_PROGRAM_FILESX86,
temp);
registry_util::RegistryOverrideManager override_manager;
override_manager.OverrideRegistry(HKEY_CURRENT_USER, base::string16());
override_manager.OverrideRegistry(HKEY_LOCAL_MACHINE, base::string16());
InstallationState machine_state; InstallationState machine_state;
machine_state.Initialize(); machine_state.Initialize();
......
...@@ -76,16 +76,16 @@ TEST_F(ProductTest, ProductInstallBasic) { ...@@ -76,16 +76,16 @@ TEST_F(ProductTest, ProductInstallBasic) {
EXPECT_EQ(std::wstring::npos, EXPECT_EQ(std::wstring::npos,
user_data_dir.value().find(program_files.value())); user_data_dir.value().find(program_files.value()));
// There should be no installed version in the registry.
machine_state.Initialize();
EXPECT_TRUE(machine_state.GetProductState(
system_level, distribution->GetType()) == NULL);
HKEY root = installer_state.root_key(); HKEY root = installer_state.root_key();
{ {
RegistryOverrideManager override_manager; RegistryOverrideManager override_manager;
override_manager.OverrideRegistry(root, L"root_pit"); override_manager.OverrideRegistry(root, L"root_pit");
// There should be no installed version in the registry.
machine_state.Initialize();
EXPECT_TRUE(machine_state.GetProductState(
system_level, distribution->GetType()) == NULL);
// Let's pretend chrome is installed. // Let's pretend chrome is installed.
RegKey version_key(root, distribution->GetVersionKey().c_str(), RegKey version_key(root, distribution->GetVersionKey().c_str(),
KEY_ALL_ACCESS); KEY_ALL_ACCESS);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment