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/install_util.h" | 5 #include "chrome/installer/util/install_util.h" |
6 | 6 |
7 #include <memory> | |
7 #include <string> | 8 #include <string> |
8 #include <utility> | 9 #include <utility> |
9 | 10 |
10 #include "base/base_paths.h" | 11 #include "base/base_paths.h" |
11 #include "base/command_line.h" | 12 #include "base/command_line.h" |
12 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
13 #include "base/files/file_util.h" | 14 #include "base/files/file_util.h" |
14 #include "base/files/scoped_temp_dir.h" | 15 #include "base/files/scoped_temp_dir.h" |
15 #include "base/macros.h" | 16 #include "base/macros.h" |
16 #include "base/path_service.h" | 17 #include "base/path_service.h" |
(...skipping 14 matching lines...) Expand all Loading... | |
31 using ::testing::StrEq; | 32 using ::testing::StrEq; |
32 | 33 |
33 class MockRegistryValuePredicate : public InstallUtil::RegistryValuePredicate { | 34 class MockRegistryValuePredicate : public InstallUtil::RegistryValuePredicate { |
34 public: | 35 public: |
35 MOCK_CONST_METHOD1(Evaluate, bool(const std::wstring&)); | 36 MOCK_CONST_METHOD1(Evaluate, bool(const std::wstring&)); |
36 }; | 37 }; |
37 | 38 |
38 class TestBrowserDistribution : public BrowserDistribution { | 39 class TestBrowserDistribution : public BrowserDistribution { |
39 public: | 40 public: |
40 TestBrowserDistribution() | 41 TestBrowserDistribution() |
41 : BrowserDistribution(CHROME_BROWSER, | 42 : BrowserDistribution(std::unique_ptr<AppRegistrationData>( |
fdoray
2017/01/10 15:07:37
MakeUnique<TestAppRegistrationData>()?
grt (UTC plus 2)
2017/01/11 08:17:54
Done.
| |
42 std::unique_ptr<AppRegistrationData>( | 43 new TestAppRegistrationData())) {} |
43 new TestAppRegistrationData())) {} | |
44 }; | 44 }; |
45 | 45 |
46 class InstallUtilTest : public testing::Test { | 46 class InstallUtilTest : public testing::Test { |
47 protected: | 47 protected: |
48 InstallUtilTest() {} | 48 InstallUtilTest() {} |
49 | 49 |
50 void SetUp() override { | 50 void SetUp() override { |
51 ResetRegistryOverrides(); | 51 ResetRegistryOverrides(); |
52 } | 52 } |
53 | 53 |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
497 ASSERT_TRUE(list->Do()); | 497 ASSERT_TRUE(list->Do()); |
498 EXPECT_EQ(current_version, | 498 EXPECT_EQ(current_version, |
499 InstallUtil::GetDowngradeVersion(system_install, &dist)); | 499 InstallUtil::GetDowngradeVersion(system_install, &dist)); |
500 list.reset(WorkItem::CreateWorkItemList()); | 500 list.reset(WorkItem::CreateWorkItemList()); |
501 InstallUtil::AddUpdateDowngradeVersionItem( | 501 InstallUtil::AddUpdateDowngradeVersionItem( |
502 system_install, nullptr, lower_new_version_1, &dist, list.get()); | 502 system_install, nullptr, lower_new_version_1, &dist, list.get()); |
503 ASSERT_TRUE(list->Do()); | 503 ASSERT_TRUE(list->Do()); |
504 ASSERT_FALSE( | 504 ASSERT_FALSE( |
505 InstallUtil::GetDowngradeVersion(system_install, &dist).IsValid()); | 505 InstallUtil::GetDowngradeVersion(system_install, &dist).IsValid()); |
506 } | 506 } |
OLD | NEW |