diff options
Diffstat (limited to 'chrome/test/automation')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 6 | ||||
-rw-r--r-- | chrome/test/automation/automation_proxy.cc | 8 | ||||
-rw-r--r-- | chrome/test/automation/automation_proxy.h | 11 | ||||
-rw-r--r-- | chrome/test/automation/extension_proxy_uitest.cc | 4 |
4 files changed, 21 insertions, 8 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index 8430172..32caec0 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -1324,8 +1324,9 @@ IPC_BEGIN_MESSAGES(Automation) // Installs an extension from the crx file and returns its id. // On error, |extension handle| will be 0. - IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_InstallExtensionAndGetHandle, + IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_InstallExtensionAndGetHandle, FilePath /* full path to crx file */, + bool /* with UI */, int /* extension handle */) // Waits for the next extension test result. Sets |test result| as the @@ -1374,4 +1375,7 @@ IPC_BEGIN_MESSAGES(Automation) bool /* success */, std::string /* property value */) + // Resets to the default theme. + IPC_SYNC_MESSAGE_ROUTED0_0(AutomationMsg_ResetToDefaultTheme) + IPC_END_MESSAGES(Automation) diff --git a/chrome/test/automation/automation_proxy.cc b/chrome/test/automation/automation_proxy.cc index ecaf5d8..d49ae9a 100644 --- a/chrome/test/automation/automation_proxy.cc +++ b/chrome/test/automation/automation_proxy.cc @@ -234,9 +234,9 @@ bool AutomationProxy::SavePackageShouldPromptUser(bool should_prompt) { } scoped_refptr<ExtensionProxy> AutomationProxy::InstallExtension( - const FilePath& crx_file) { + const FilePath& crx_file, bool with_ui) { int handle = 0; - if (!Send(new AutomationMsg_InstallExtensionAndGetHandle(0, crx_file, + if (!Send(new AutomationMsg_InstallExtensionAndGetHandle(0, crx_file, with_ui, &handle))) return NULL; @@ -531,3 +531,7 @@ bool AutomationProxy::LoginWithUserAndPass(const std::string& username, return sent && success; } #endif + +bool AutomationProxy::ResetToDefaultTheme() { + return Send(new AutomationMsg_ResetToDefaultTheme(0)); +} diff --git a/chrome/test/automation/automation_proxy.h b/chrome/test/automation/automation_proxy.h index f68633e..45286fe 100644 --- a/chrome/test/automation/automation_proxy.h +++ b/chrome/test/automation/automation_proxy.h @@ -183,10 +183,12 @@ class AutomationProxy : public IPC::Channel::Listener, // sent. bool SavePackageShouldPromptUser(bool should_prompt) WARN_UNUSED_RESULT; - // Installs the extension crx. Returns the ExtensionProxy for the - // installed extension, or NULL on failure. + // Installs the extension crx. If |with_ui| is true an install confirmation + // and notification UI is shown, otherwise the install is silent. Returns the + // ExtensionProxy for the installed extension, or NULL on failure. // Note: Overinstalls and downgrades will return NULL. - scoped_refptr<ExtensionProxy> InstallExtension(const FilePath& crx_file); + scoped_refptr<ExtensionProxy> InstallExtension(const FilePath& crx_file, + bool with_ui); // Asserts that the next extension test result is true. void EnsureExtensionTestResult(); @@ -195,6 +197,9 @@ class AutomationProxy : public IPC::Channel::Listener, // Returns true on success. bool GetEnabledExtensions(std::vector<FilePath>* extension_directories); + // Resets to the default theme. Returns true on success. + bool ResetToDefaultTheme(); + #if defined(OS_CHROMEOS) // Logs in through the Chrome OS login wizard with given |username| // and |password|. Returns true on success. diff --git a/chrome/test/automation/extension_proxy_uitest.cc b/chrome/test/automation/extension_proxy_uitest.cc index 18d385c..0954f5a 100644 --- a/chrome/test/automation/extension_proxy_uitest.cc +++ b/chrome/test/automation/extension_proxy_uitest.cc @@ -32,7 +32,7 @@ class ExtensionProxyUITest : public UITest { scoped_refptr<ExtensionProxy> InstallSimpleBrowserActionExtension() { return automation()->InstallExtension( test_data_directory_.AppendASCII("extensions").AppendASCII("uitest"). - AppendASCII("simple_browser_action.crx")); + AppendASCII("simple_browser_action.crx"), false); } // Installs a extension which, when clicking the browser action, renames @@ -41,7 +41,7 @@ class ExtensionProxyUITest : public UITest { scoped_refptr<ExtensionProxy> InstallRenameTabExtension() { return automation()->InstallExtension( test_data_directory_.AppendASCII("extensions").AppendASCII("uitest"). - AppendASCII("rename_tab.crx")); + AppendASCII("rename_tab.crx"), false); } // The google translate extension, which is installed on test setup. |