diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-19 02:49:18 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-19 02:49:18 +0000 |
commit | ef8561def41e78e9a56939246d3331703ab93c0d (patch) | |
tree | 12d14cefca2d95fef63275d97b29f92bbcbcb277 /chrome_frame | |
parent | 4751c74ecc02d7baa5a56fafd5a4e29a779d168a (diff) | |
download | chromium_src-ef8561def41e78e9a56939246d3331703ab93c0d.zip chromium_src-ef8561def41e78e9a56939246d3331703ab93c0d.tar.gz chromium_src-ef8561def41e78e9a56939246d3331703ab93c0d.tar.bz2 |
Fix the ChromeFrame MockCreateTabOk test by returning the launch result from the CreateExternalTabComplete helper
and passing the same to the InitializeComplete function which eventually gets passed down to the mock delegate which expects
a failure.
Bug=44245
TBR=stoyan
Review URL: http://codereview.chromium.org/2114009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47617 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/chrome_frame_automation.cc | 9 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_automation.h | 5 | ||||
-rw-r--r-- | chrome_frame/custom_sync_call_context.h | 6 |
3 files changed, 12 insertions, 8 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 257e20b..33ab786 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -484,7 +484,7 @@ bool ChromeFrameAutomationClient::Initialize( ui_thread_id_ = PlatformThread::CurrentId(); #ifndef NDEBUG // In debug mode give more time to work with a debugger. - if (0 && IsDebuggerPresent()) { + if (IsDebuggerPresent()) { // Don't use INFINITE (which is -1) or even MAXINT since we will convert // from milliseconds to microseconds when stored in a base::TimeDelta, // thus * 1000. An hour should be enough. @@ -813,13 +813,13 @@ void ChromeFrameAutomationClient::CreateExternalTab() { this); } -void ChromeFrameAutomationClient::CreateExternalTabComplete(HWND chrome_window, - HWND tab_window, int tab_handle) { +AutomationLaunchResult ChromeFrameAutomationClient::CreateExternalTabComplete( + HWND chrome_window, HWND tab_window, int tab_handle) { if (!automation_server_) { // If we receive this notification while shutting down, do nothing. DLOG(ERROR) << "CreateExternalTabComplete called when automation server " << "was null!"; - return; + return AUTOMATION_CREATE_TAB_FAILED; } AutomationLaunchResult launch_result = AUTOMATION_SUCCESS; @@ -832,6 +832,7 @@ void ChromeFrameAutomationClient::CreateExternalTabComplete(HWND chrome_window, tab_->AddObserver(this); tab_handle_ = tab_handle; } + return launch_result; } void ChromeFrameAutomationClient::SetEnableExtensionAutomation( diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index 78e1d30..7b9b774 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -282,8 +282,9 @@ class ChromeFrameAutomationClient virtual void OnChannelError(TabProxy* tab); void CreateExternalTab(); - void CreateExternalTabComplete(HWND chrome_window, HWND tab_window, - int tab_handle); + AutomationLaunchResult CreateExternalTabComplete(HWND chrome_window, + HWND tab_window, + int tab_handle); // Called in UI thread. Here we fire event to the client notifying for // the result of Initialize() method call. void InitializeComplete(AutomationLaunchResult result); diff --git a/chrome_frame/custom_sync_call_context.h b/chrome_frame/custom_sync_call_context.h index c9242d6..28812ef 100644 --- a/chrome_frame/custom_sync_call_context.h +++ b/chrome_frame/custom_sync_call_context.h @@ -90,12 +90,14 @@ class CreateExternalTabContext } void Completed(HWND chrome_window, HWND tab_window, int tab_handle) { - client_->CreateExternalTabComplete(chrome_window, tab_window, tab_handle); + AutomationLaunchResult launch_result = + client_->CreateExternalTabComplete(chrome_window, tab_window, + tab_handle); client_->PostTask(FROM_HERE, NewRunnableMethod( client_.get(), &ChromeFrameAutomationClient::InitializeComplete, - AUTOMATION_SUCCESS)); + launch_result)); } private: |