OLD | NEW |
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/google_update_settings.h" | 5 #include "chrome/installer/util/google_update_settings.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shlwapi.h> // For SHDeleteKey. | 8 #include <shlwapi.h> // For SHDeleteKey. |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
| 11 #include <memory> |
| 12 |
11 #include "base/base_paths.h" | 13 #include "base/base_paths.h" |
12 #include "base/macros.h" | 14 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/path_service.h" | 15 #include "base/path_service.h" |
15 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
16 #include "base/test/scoped_path_override.h" | 17 #include "base/test/scoped_path_override.h" |
17 #include "base/test/test_reg_util_win.h" | 18 #include "base/test/test_reg_util_win.h" |
18 #include "base/win/registry.h" | 19 #include "base/win/registry.h" |
19 #include "base/win/win_util.h" | 20 #include "base/win/win_util.h" |
20 #include "chrome/common/chrome_constants.h" | 21 #include "chrome/common/chrome_constants.h" |
21 #include "chrome/installer/util/app_registration_data.h" | 22 #include "chrome/installer/util/app_registration_data.h" |
22 #include "chrome/installer/util/browser_distribution.h" | 23 #include "chrome/installer/util/browser_distribution.h" |
23 #include "chrome/installer/util/channel_info.h" | 24 #include "chrome/installer/util/channel_info.h" |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 << "archive_type: " << archive_type | 493 << "archive_type: " << archive_type |
493 << ", result: " << result | 494 << ", result: " << result |
494 << ", input ap value: " << input; | 495 << ", input ap value: " << input; |
495 } | 496 } |
496 } | 497 } |
497 } | 498 } |
498 } | 499 } |
499 } | 500 } |
500 | 501 |
501 TEST_F(GoogleUpdateSettingsTest, UpdateInstallStatusTest) { | 502 TEST_F(GoogleUpdateSettingsTest, UpdateInstallStatusTest) { |
502 scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList()); | 503 std::unique_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList()); |
503 // Test incremental install failure | 504 // Test incremental install failure |
504 ASSERT_TRUE(CreateApKey(work_item_list.get(), L"")) | 505 ASSERT_TRUE(CreateApKey(work_item_list.get(), L"")) |
505 << "Failed to create ap key."; | 506 << "Failed to create ap key."; |
506 GoogleUpdateSettings::UpdateInstallStatus(false, | 507 GoogleUpdateSettings::UpdateInstallStatus(false, |
507 installer::INCREMENTAL_ARCHIVE_TYPE, | 508 installer::INCREMENTAL_ARCHIVE_TYPE, |
508 installer::INSTALL_FAILED, | 509 installer::INSTALL_FAILED, |
509 kTestProductGuid); | 510 kTestProductGuid); |
510 EXPECT_STREQ(ReadApKeyValue().c_str(), L"-full"); | 511 EXPECT_STREQ(ReadApKeyValue().c_str(), L"-full"); |
511 work_item_list->Rollback(); | 512 work_item_list->Rollback(); |
512 | 513 |
(...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1418 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1419 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1419 StatsState::FALSE_SETTING, StatsState::FALSE_SETTING), | 1420 StatsState::FALSE_SETTING, StatsState::FALSE_SETTING), |
1420 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1421 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1421 StatsState::FALSE_SETTING, StatsState::TRUE_SETTING), | 1422 StatsState::FALSE_SETTING, StatsState::TRUE_SETTING), |
1422 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1423 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1423 StatsState::TRUE_SETTING, StatsState::NO_SETTING), | 1424 StatsState::TRUE_SETTING, StatsState::NO_SETTING), |
1424 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1425 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1425 StatsState::TRUE_SETTING, StatsState::FALSE_SETTING), | 1426 StatsState::TRUE_SETTING, StatsState::FALSE_SETTING), |
1426 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, | 1427 StatsState(StatsState::kSystemLevel, StatsState::MULTI_INSTALL, |
1427 StatsState::TRUE_SETTING, StatsState::TRUE_SETTING))); | 1428 StatsState::TRUE_SETTING, StatsState::TRUE_SETTING))); |
OLD | NEW |