diff options
author | rolandsteiner@chromium.org <rolandsteiner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 04:33:11 +0000 |
---|---|---|
committer | rolandsteiner@chromium.org <rolandsteiner@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-09 04:33:11 +0000 |
commit | 7e6ecaaf0315c518b6223607d1684255c3d8c7a8 (patch) | |
tree | 33ecb333c979e74d7160abcb446781c1f0c7782d /chrome/test | |
parent | 72019a142cb65deac06491e779383e3f28118a8e (diff) | |
download | chromium_src-7e6ecaaf0315c518b6223607d1684255c3d8c7a8.zip chromium_src-7e6ecaaf0315c518b6223607d1684255c3d8c7a8.tar.gz chromium_src-7e6ecaaf0315c518b6223607d1684255c3d8c7a8.tar.bz2 |
Commit Issue 255057: Unit Test for Toggling of Encoding Auto-Detect
BUG=23617
TEST=BrowserEncodingTest.TestToggleAutoDetect
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31419 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test')
-rw-r--r-- | chrome/test/automation/automation_messages_internal.h | 9 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.cc | 11 | ||||
-rw-r--r-- | chrome/test/automation/tab_proxy.h | 9 |
3 files changed, 24 insertions, 5 deletions
diff --git a/chrome/test/automation/automation_messages_internal.h b/chrome/test/automation/automation_messages_internal.h index d2f7458..db102a7 100644 --- a/chrome/test/automation/automation_messages_internal.h +++ b/chrome/test/automation/automation_messages_internal.h @@ -797,7 +797,7 @@ IPC_BEGIN_MESSAGES(Automation) int64 /* last navigation time */) // This messages is used to block until a new navigation occurs (if there is - // none more recent then the time specified). + // none more recent than the time specified). IPC_SYNC_MESSAGE_ROUTED2_1(AutomationMsg_WaitForNavigation, int /* tab_handle */, int64 /* last navigation time */, @@ -1184,4 +1184,11 @@ IPC_BEGIN_MESSAGES(Automation) int /* tab_handle */, int /* request_id */) + // Toggles the auto-detect encoding setting. + // While the setting is global, the tab needs to be specified as it may need + // to be reloaded. + IPC_SYNC_MESSAGE_ROUTED1_1(AutomationMsg_ToggleEncodingAutoDetect, + int /* tab handle */, + bool /* success */) + IPC_END_MESSAGES(Automation) diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index 43246ea..875bc3a 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -664,6 +664,16 @@ bool TabProxy::GetPageCurrentEncoding(std::string* encoding) { return succeeded; } +bool TabProxy::ToggleEncodingAutoDetect() { + if (!is_valid()) + return false; + + bool succeeded = false; + sender_->Send(new AutomationMsg_ToggleEncodingAutoDetect(0, handle_, + &succeeded)); + return succeeded; +} + bool TabProxy::OverrideEncoding(const std::string& encoding) { if (!is_valid()) return false; @@ -678,7 +688,6 @@ bool TabProxy::OverrideEncoding(const std::string& encoding) { void TabProxy::Reposition(HWND window, HWND window_insert_after, int left, int top, int width, int height, int flags, HWND parent_window) { - IPC::Reposition_Params params = {0}; params.window = window; params.window_insert_after = window_insert_after; diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index 7693e60..0cc3f26 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -327,9 +327,9 @@ class TabProxy : public AutomationResourceProxy { // to be used with WaitForNavigation (see below). bool GetLastNavigationTime(int64* last_navigation_time); - // Waits for a new navigation if none as occurred since |last_navigation_time| - // The purpose of this function is for operations that causes asynchronous - // navigation to happen. + // Waits for a new navigation if none has occurred since + // |last_navigation_time|. The purpose of this function is for operations + // that causes asynchronous navigation to happen. // It is supposed to be used as follow: // int64 last_nav_time; // tab_proxy->GetLastNavigationTime(&last_nav_time); @@ -340,6 +340,9 @@ class TabProxy : public AutomationResourceProxy { // Gets the current used encoding of the page in the tab. bool GetPageCurrentEncoding(std::string* encoding); + // Toggles encoding auto-detect of the page in the tab + bool ToggleEncodingAutoDetect(); + // Uses the specified encoding to override encoding of the page in the tab. bool OverrideEncoding(const std::string& encoding); |