| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <windows.h> | 5 #include <windows.h> |
| 6 | 6 |
| 7 #include <fstream> | 7 #include <fstream> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 389 InstallerState state; | 389 InstallerState state; |
| 390 state.Initialize(cmd_line, prefs, machine_state); | 390 state.Initialize(cmd_line, prefs, machine_state); |
| 391 state.WriteInstallerResult(installer::FIRST_INSTALL_SUCCESS, | 391 state.WriteInstallerResult(installer::FIRST_INSTALL_SUCCESS, |
| 392 IDS_INSTALL_OS_ERROR_BASE, &launch_cmd); | 392 IDS_INSTALL_OS_ERROR_BASE, &launch_cmd); |
| 393 BrowserDistribution* distribution = | 393 BrowserDistribution* distribution = |
| 394 BrowserDistribution::GetSpecificDistribution( | 394 BrowserDistribution::GetSpecificDistribution( |
| 395 BrowserDistribution::CHROME_BROWSER); | 395 BrowserDistribution::CHROME_BROWSER); |
| 396 EXPECT_EQ(ERROR_SUCCESS, | 396 EXPECT_EQ(ERROR_SUCCESS, |
| 397 key.Open(root, distribution->GetStateKey().c_str(), KEY_READ)); | 397 key.Open(root, distribution->GetStateKey().c_str(), KEY_READ)); |
| 398 EXPECT_EQ(ERROR_SUCCESS, | 398 EXPECT_EQ(ERROR_SUCCESS, |
| 399 key.ReadValueDW(installer::kInstallerResult, &dw_value)); | 399 key.ReadValue(installer::kInstallerResult, &dw_value)); |
| 400 EXPECT_EQ(static_cast<DWORD>(0), dw_value); | 400 EXPECT_EQ(static_cast<DWORD>(0), dw_value); |
| 401 EXPECT_EQ(ERROR_SUCCESS, | 401 EXPECT_EQ(ERROR_SUCCESS, |
| 402 key.ReadValueDW(installer::kInstallerError, &dw_value)); | 402 key.ReadValue(installer::kInstallerError, &dw_value)); |
| 403 EXPECT_EQ(static_cast<DWORD>(installer::FIRST_INSTALL_SUCCESS), dw_value); | 403 EXPECT_EQ(static_cast<DWORD>(installer::FIRST_INSTALL_SUCCESS), dw_value); |
| 404 EXPECT_EQ(ERROR_SUCCESS, | 404 EXPECT_EQ(ERROR_SUCCESS, |
| 405 key.ReadValue(installer::kInstallerResultUIString, &value)); | 405 key.ReadValue(installer::kInstallerResultUIString, &value)); |
| 406 EXPECT_FALSE(value.empty()); | 406 EXPECT_FALSE(value.empty()); |
| 407 EXPECT_EQ(ERROR_SUCCESS, | 407 EXPECT_EQ(ERROR_SUCCESS, |
| 408 key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, &value)); | 408 key.ReadValue(installer::kInstallerSuccessLaunchCmdLine, &value)); |
| 409 EXPECT_EQ(launch_cmd, value); | 409 EXPECT_EQ(launch_cmd, value); |
| 410 } | 410 } |
| 411 | 411 |
| 412 // check results for a fresh install of multi Chrome | 412 // check results for a fresh install of multi Chrome |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 NULL, OPEN_EXISTING, 0, 0)); | 484 NULL, OPEN_EXISTING, 0, 0)); |
| 485 ASSERT_TRUE(temp_handle != NULL); | 485 ASSERT_TRUE(temp_handle != NULL); |
| 486 | 486 |
| 487 // The file should now be in use. | 487 // The file should now be in use. |
| 488 EXPECT_TRUE(MockInstallerState::IsFileInUse(temp_file)); | 488 EXPECT_TRUE(MockInstallerState::IsFileInUse(temp_file)); |
| 489 } | 489 } |
| 490 | 490 |
| 491 // And once the handle is gone, it should no longer be in use. | 491 // And once the handle is gone, it should no longer be in use. |
| 492 EXPECT_FALSE(MockInstallerState::IsFileInUse(temp_file)); | 492 EXPECT_FALSE(MockInstallerState::IsFileInUse(temp_file)); |
| 493 } | 493 } |
| OLD | NEW |