diff options
author | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-18 05:38:54 +0000 |
---|---|---|
committer | jorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-18 05:38:54 +0000 |
commit | 140debc9ab97da79036d70db21859d771cecf134 (patch) | |
tree | bb5a7ab2e15869ee14cc4a9c77a2848fb089d325 /chrome/test/automation | |
parent | edc53eb89220666a85fac4fe4fee9f0de52bd4ab (diff) | |
download | chromium_src-140debc9ab97da79036d70db21859d771cecf134.zip chromium_src-140debc9ab97da79036d70db21859d771cecf134.tar.gz chromium_src-140debc9ab97da79036d70db21859d771cecf134.tar.bz2 |
Select and close previous theme info bars when resetting to default theme via the options dialog. As a nice side effect if one tab is showing a theme info bar and the user switches to a different theme in another tab, this change closes the previous theme info bars as well.
BUG=35607
TEST=Install a theme, and with the theme info bar visible open Preferences dialog and click 'reset to default theme' and check the info bar. (full steps given in the above bug entry)
Landing http://codereview.chromium.org/1622017/show for Satish.
Review URL: http://codereview.chromium.org/1600030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44885 0039d316-1c4b-4281-b951-d872f2087c98
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. |