| 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 int expected_change, | 194 int expected_change, |
| 195 extensions::Manifest::Location install_source, | 195 extensions::Manifest::Location install_source, |
| 196 extensions::Extension::InitFromValueFlags creation_flags) { | 196 extensions::Extension::InitFromValueFlags creation_flags) { |
| 197 return InstallOrUpdateExtension(std::string(), | 197 return InstallOrUpdateExtension(std::string(), |
| 198 path, | 198 path, |
| 199 INSTALL_UI_TYPE_NONE, | 199 INSTALL_UI_TYPE_NONE, |
| 200 expected_change, | 200 expected_change, |
| 201 install_source, | 201 install_source, |
| 202 browser(), | 202 browser(), |
| 203 creation_flags, | 203 creation_flags, |
| 204 false, | |
| 205 false); | 204 false); |
| 206 } | 205 } |
| 207 | 206 |
| 208 const extensions::Extension* InstallEphemeralAppWithSourceAndFlags( | |
| 209 const base::FilePath& path, | |
| 210 int expected_change, | |
| 211 extensions::Manifest::Location install_source, | |
| 212 extensions::Extension::InitFromValueFlags creation_flags) { | |
| 213 return InstallOrUpdateExtension(std::string(), | |
| 214 path, | |
| 215 INSTALL_UI_TYPE_NONE, | |
| 216 expected_change, | |
| 217 install_source, | |
| 218 browser(), | |
| 219 creation_flags, | |
| 220 false, | |
| 221 true); | |
| 222 } | |
| 223 | |
| 224 // Begins install process but simulates a user cancel. | 207 // Begins install process but simulates a user cancel. |
| 225 const extensions::Extension* StartInstallButCancel( | 208 const extensions::Extension* StartInstallButCancel( |
| 226 const base::FilePath& path) { | 209 const base::FilePath& path) { |
| 227 return InstallOrUpdateExtension( | 210 return InstallOrUpdateExtension( |
| 228 std::string(), path, INSTALL_UI_TYPE_CANCEL, 0); | 211 std::string(), path, INSTALL_UI_TYPE_CANCEL, 0); |
| 229 } | 212 } |
| 230 | 213 |
| 231 void ReloadExtension(const std::string& extension_id); | 214 void ReloadExtension(const std::string& extension_id); |
| 232 | 215 |
| 233 void UnloadExtension(const std::string& extension_id); | 216 void UnloadExtension(const std::string& extension_id); |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 int expected_change, | 351 int expected_change, |
| 369 extensions::Manifest::Location install_source); | 352 extensions::Manifest::Location install_source); |
| 370 const extensions::Extension* InstallOrUpdateExtension( | 353 const extensions::Extension* InstallOrUpdateExtension( |
| 371 const std::string& id, | 354 const std::string& id, |
| 372 const base::FilePath& path, | 355 const base::FilePath& path, |
| 373 InstallUIType ui_type, | 356 InstallUIType ui_type, |
| 374 int expected_change, | 357 int expected_change, |
| 375 extensions::Manifest::Location install_source, | 358 extensions::Manifest::Location install_source, |
| 376 Browser* browser, | 359 Browser* browser, |
| 377 extensions::Extension::InitFromValueFlags creation_flags, | 360 extensions::Extension::InitFromValueFlags creation_flags, |
| 378 bool wait_for_idle, | 361 bool wait_for_idle); |
| 379 bool is_ephemeral); | |
| 380 | 362 |
| 381 // Make the current channel "dev" for the duration of the test. | 363 // Make the current channel "dev" for the duration of the test. |
| 382 extensions::ScopedCurrentChannel current_channel_; | 364 extensions::ScopedCurrentChannel current_channel_; |
| 383 | 365 |
| 384 // Disable external install UI. | 366 // Disable external install UI. |
| 385 extensions::FeatureSwitch::ScopedOverride | 367 extensions::FeatureSwitch::ScopedOverride |
| 386 override_prompt_for_external_extensions_; | 368 override_prompt_for_external_extensions_; |
| 387 | 369 |
| 388 #if defined(OS_WIN) | 370 #if defined(OS_WIN) |
| 389 // Use mock shortcut directories to ensure app shortcuts are cleaned up. | 371 // Use mock shortcut directories to ensure app shortcuts are cleaned up. |
| 390 base::ScopedPathOverride user_desktop_override_; | 372 base::ScopedPathOverride user_desktop_override_; |
| 391 base::ScopedPathOverride common_desktop_override_; | 373 base::ScopedPathOverride common_desktop_override_; |
| 392 base::ScopedPathOverride user_quick_launch_override_; | 374 base::ScopedPathOverride user_quick_launch_override_; |
| 393 base::ScopedPathOverride start_menu_override_; | 375 base::ScopedPathOverride start_menu_override_; |
| 394 base::ScopedPathOverride common_start_menu_override_; | 376 base::ScopedPathOverride common_start_menu_override_; |
| 395 #endif | 377 #endif |
| 396 | 378 |
| 397 // The default profile to be used. | 379 // The default profile to be used. |
| 398 Profile* profile_; | 380 Profile* profile_; |
| 399 | 381 |
| 400 // Cache cache implementation. | 382 // Cache cache implementation. |
| 401 scoped_ptr<extensions::ExtensionCacheFake> test_extension_cache_; | 383 scoped_ptr<extensions::ExtensionCacheFake> test_extension_cache_; |
| 402 }; | 384 }; |
| 403 | 385 |
| 404 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ | 386 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_BROWSERTEST_H_ |
| OLD | NEW |