diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 20:24:24 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-03 20:24:24 +0000 |
commit | 811b8a13d93483819b506190f5a6ae655bc48734 (patch) | |
tree | 830afc0f38ae8d31eec00c852ea673a7bef90d22 | |
parent | 54882d97080cefde3e830e3f1ef307a6136982d5 (diff) | |
download | chromium_src-811b8a13d93483819b506190f5a6ae655bc48734.zip chromium_src-811b8a13d93483819b506190f5a6ae655bc48734.tar.gz chromium_src-811b8a13d93483819b506190f5a6ae655bc48734.tar.bz2 |
Merge 108498 - Wait for the tab opened by the extension to be loaded before navigating it
Turns out that a precondition for NavigateToURL is that the tab is currently not navigating. While about:blank loads very quickly, on slow machines it might take to long, so NavigateToURL fails
BUG=101078
TEST=ExtensionApiTest.WebNavigationUserAction doesn't time out on official mac builders
Review URL: http://codereview.chromium.org/8334023
TBR=jochen@chromium.org
Review URL: http://codereview.chromium.org/8443003
git-svn-id: svn://svn.chromium.org/chrome/branches/912/src@108535 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/extensions/extension_webnavigation_apitest.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/extensions/extension_webnavigation_apitest.cc b/chrome/browser/extensions/extension_webnavigation_apitest.cc index 22fb035..bf546d5 100644 --- a/chrome/browser/extensions/extension_webnavigation_apitest.cc +++ b/chrome/browser/extensions/extension_webnavigation_apitest.cc @@ -122,6 +122,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) { ASSERT_TRUE( RunExtensionSubtest("webnavigation", "test_userAction.html")) << message_; + TabContents* tab = browser()->GetSelectedTabContents(); + ui_test_utils::WaitForLoadStop(tab); + ResultCatcher catcher; ExtensionService* service = browser()->profile()->GetExtensionService(); @@ -132,7 +135,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) { ui_test_utils::NavigateToURL(browser(), url); // This corresponds to "Open link in new tab". - TabContents* tab = browser()->GetSelectedTabContents(); ContextMenuParams params; params.is_editable = false; params.media_type = WebKit::WebContextMenuData::MediaTypeNone; @@ -156,6 +158,9 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationRequestOpenTab) { ASSERT_TRUE(RunExtensionSubtest("webnavigation", "test_requestOpenTab.html")) << message_; + TabContents* tab = browser()->GetSelectedTabContents(); + ui_test_utils::WaitForLoadStop(tab); + ResultCatcher catcher; ExtensionService* service = browser()->profile()->GetExtensionService(); @@ -172,7 +177,6 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationRequestOpenTab) { mouse_event.x = 7; mouse_event.y = 7; mouse_event.clickCount = 1; - TabContents* tab = browser()->GetSelectedTabContents(); tab->render_view_host()->ForwardMouseEvent(mouse_event); mouse_event.type = WebKit::WebInputEvent::MouseUp; tab->render_view_host()->ForwardMouseEvent(mouse_event); |