OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 FROM_HERE, | 101 FROM_HERE, |
102 base::Bind(&ZipFileInstaller::LoadFromZipFile, | 102 base::Bind(&ZipFileInstaller::LoadFromZipFile, |
103 zipfile_installer_.get(), | 103 zipfile_installer_.get(), |
104 original_path)); | 104 original_path)); |
105 observer_.WaitForInstall(); | 105 observer_.WaitForInstall(); |
106 } | 106 } |
107 | 107 |
108 protected: | 108 protected: |
109 scoped_refptr<ZipFileInstaller> zipfile_installer_; | 109 scoped_refptr<ZipFileInstaller> zipfile_installer_; |
110 | 110 |
111 scoped_ptr<TestingProfile> profile_; | 111 std::unique_ptr<TestingProfile> profile_; |
112 ExtensionService* extension_service_; | 112 ExtensionService* extension_service_; |
113 | 113 |
114 content::TestBrowserThreadBundle browser_threads_; | 114 content::TestBrowserThreadBundle browser_threads_; |
115 scoped_ptr<content::InProcessUtilityThreadHelper> | 115 std::unique_ptr<content::InProcessUtilityThreadHelper> |
116 in_process_utility_thread_helper_; | 116 in_process_utility_thread_helper_; |
117 MockExtensionRegistryObserver observer_; | 117 MockExtensionRegistryObserver observer_; |
118 | 118 |
119 #if defined(OS_CHROMEOS) | 119 #if defined(OS_CHROMEOS) |
120 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; | 120 chromeos::ScopedTestDeviceSettingsService test_device_settings_service_; |
121 chromeos::ScopedTestCrosSettings test_cros_settings_; | 121 chromeos::ScopedTestCrosSettings test_cros_settings_; |
122 // ChromeOS needs a user manager to instantiate an extension service. | 122 // ChromeOS needs a user manager to instantiate an extension service. |
123 chromeos::ScopedTestUserManager test_user_manager_; | 123 chromeos::ScopedTestUserManager test_user_manager_; |
124 #endif | 124 #endif |
125 }; | 125 }; |
126 | 126 |
127 TEST_F(ZipFileInstallerTest, GoodZip) { | 127 TEST_F(ZipFileInstallerTest, GoodZip) { |
128 RunInstaller("good.zip"); | 128 RunInstaller("good.zip"); |
129 } | 129 } |
130 | 130 |
131 TEST_F(ZipFileInstallerTest, ZipWithPublicKey) { | 131 TEST_F(ZipFileInstallerTest, ZipWithPublicKey) { |
132 RunInstaller("public_key.zip"); | 132 RunInstaller("public_key.zip"); |
133 const char kIdForPublicKey[] = "ikppjpenhoddphklkpdfdfdabbakkpal"; | 133 const char kIdForPublicKey[] = "ikppjpenhoddphklkpdfdfdabbakkpal"; |
134 EXPECT_EQ(observer_.last_extension_installed, kIdForPublicKey); | 134 EXPECT_EQ(observer_.last_extension_installed, kIdForPublicKey); |
135 } | 135 } |
136 | 136 |
137 } // namespace extensions | 137 } // namespace extensions |
OLD | NEW |