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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 expected_change, | 181 expected_change, |
182 browser, | 182 browser, |
183 extensions::Extension::NO_FLAGS); | 183 extensions::Extension::NO_FLAGS); |
184 } | 184 } |
185 | 185 |
186 const extensions::Extension* InstallExtensionWithSourceAndFlags( | 186 const extensions::Extension* InstallExtensionWithSourceAndFlags( |
187 const base::FilePath& path, | 187 const base::FilePath& path, |
188 int expected_change, | 188 int expected_change, |
189 extensions::Manifest::Location install_source, | 189 extensions::Manifest::Location install_source, |
190 extensions::Extension::InitFromValueFlags creation_flags) { | 190 extensions::Extension::InitFromValueFlags creation_flags) { |
191 return InstallOrUpdateExtension(std::string(), path, INSTALL_UI_TYPE_NONE, | 191 return InstallOrUpdateExtension(std::string(), |
192 expected_change, install_source, browser(), creation_flags, false); | 192 path, |
| 193 INSTALL_UI_TYPE_NONE, |
| 194 expected_change, |
| 195 install_source, |
| 196 browser(), |
| 197 creation_flags, |
| 198 false, |
| 199 false); |
| 200 } |
| 201 |
| 202 const extensions::Extension* InstallEphemeralAppWithSourceAndFlags( |
| 203 const base::FilePath& path, |
| 204 int expected_change, |
| 205 extensions::Manifest::Location install_source, |
| 206 extensions::Extension::InitFromValueFlags creation_flags) { |
| 207 return InstallOrUpdateExtension(std::string(), |
| 208 path, |
| 209 INSTALL_UI_TYPE_NONE, |
| 210 expected_change, |
| 211 install_source, |
| 212 browser(), |
| 213 creation_flags, |
| 214 false, |
| 215 true); |
193 } | 216 } |
194 | 217 |
195 // Begins install process but simulates a user cancel. | 218 // Begins install process but simulates a user cancel. |
196 const extensions::Extension* StartInstallButCancel( | 219 const extensions::Extension* StartInstallButCancel( |
197 const base::FilePath& path) { | 220 const base::FilePath& path) { |
198 return InstallOrUpdateExtension( | 221 return InstallOrUpdateExtension( |
199 std::string(), path, INSTALL_UI_TYPE_CANCEL, 0); | 222 std::string(), path, INSTALL_UI_TYPE_CANCEL, 0); |
200 } | 223 } |
201 | 224 |
202 void ReloadExtension(const std::string extension_id); | 225 void ReloadExtension(const std::string extension_id); |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 int expected_change, | 363 int expected_change, |
341 extensions::Manifest::Location install_source); | 364 extensions::Manifest::Location install_source); |
342 const extensions::Extension* InstallOrUpdateExtension( | 365 const extensions::Extension* InstallOrUpdateExtension( |
343 const std::string& id, | 366 const std::string& id, |
344 const base::FilePath& path, | 367 const base::FilePath& path, |
345 InstallUIType ui_type, | 368 InstallUIType ui_type, |
346 int expected_change, | 369 int expected_change, |
347 extensions::Manifest::Location install_source, | 370 extensions::Manifest::Location install_source, |
348 Browser* browser, | 371 Browser* browser, |
349 extensions::Extension::InitFromValueFlags creation_flags, | 372 extensions::Extension::InitFromValueFlags creation_flags, |
350 bool wait_for_idle); | 373 bool wait_for_idle, |
| 374 bool is_ephemeral); |
351 | 375 |
352 // Make the current channel "dev" for the duration of the test. | 376 // Make the current channel "dev" for the duration of the test. |
353 extensions::ScopedCurrentChannel current_channel_; | 377 extensions::ScopedCurrentChannel current_channel_; |
354 | 378 |
355 // Disable external install UI. | 379 // Disable external install UI. |
356 extensions::FeatureSwitch::ScopedOverride | 380 extensions::FeatureSwitch::ScopedOverride |
357 override_prompt_for_external_extensions_; | 381 override_prompt_for_external_extensions_; |
358 | 382 |
359 // The default profile to be used. | 383 // The default profile to be used. |
360 Profile* profile_; | 384 Profile* profile_; |
361 | 385 |
362 // Cache cache implementation. | 386 // Cache cache implementation. |
363 scoped_ptr<extensions::ExtensionCacheFake> test_extension_cache_; | 387 scoped_ptr<extensions::ExtensionCacheFake> test_extension_cache_; |
364 }; | 388 }; |
365 | 389 |
366 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 390 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
OLD | NEW |