summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/extension_uitest.cc
diff options
context:
space:
mode:
authoramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 22:33:58 +0000
committeramit@chromium.org <amit@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-11 22:33:58 +0000
commitf5cde2b583d923436f728660e18e181f83cfa602 (patch)
treec419f1b05a7525bdd7b24d86641974e45a8f1237 /chrome/browser/extensions/extension_uitest.cc
parent279cd421c952d1581b4ac9bbc977e5f08b45d3b3 (diff)
downloadchromium_src-f5cde2b583d923436f728660e18e181f83cfa602.zip
chromium_src-f5cde2b583d923436f728660e18e181f83cfa602.tar.gz
chromium_src-f5cde2b583d923436f728660e18e181f83cfa602.tar.bz2
ExternalTabcontainer browser to initial URL
Browse the newly created external tab to the specified initial URL if present, to about:blank otherwise. Also send information about SSL status when sending navigation updates to the automation client. BUG=none TEST=CreateExternalTabWithUrl UI test Review URL: http://codereview.chromium.org/193054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@26037 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_uitest.cc')
-rw-r--r--chrome/browser/extensions/extension_uitest.cc45
1 files changed, 22 insertions, 23 deletions
diff --git a/chrome/browser/extensions/extension_uitest.cc b/chrome/browser/extensions/extension_uitest.cc
index 28c06f6..0dcc28a 100644
--- a/chrome/browser/extensions/extension_uitest.cc
+++ b/chrome/browser/extensions/extension_uitest.cc
@@ -54,31 +54,30 @@ class ExtensionUITest : public ParentTestType {
}
void TestWithURL(const GURL& url) {
- const IPC::ExternalTabSettings settings = {
- NULL,
- gfx::Rect(),
- WS_POPUP,
- false,
- false
- };
-
+ AutomationProxyForExternalTab* proxy =
+ static_cast<AutomationProxyForExternalTab*>(automation());
HWND external_tab_container = NULL;
HWND tab_wnd = NULL;
- scoped_refptr<TabProxy> tab(automation()->CreateExternalTab(settings,
- &external_tab_container, &tab_wnd));
- ASSERT_TRUE(tab != NULL);
- ASSERT_NE(FALSE, ::IsWindow(external_tab_container));
- DoAdditionalPreNavigateSetup(tab.get());
-
- // We explicitly do not make this a toolstrip in the extension manifest,
- // so that the test can control when it gets loaded, and so that we test
- // the intended behavior that tabs should be able to show extension pages
- // (useful for development etc.)
- tab->NavigateInExternalTab(url);
- EXPECT_EQ(true, ExternalTabMessageLoop(external_tab_container, 5000));
- // Since the tab goes away lazily, wait a bit.
- PlatformThread::Sleep(1000);
- EXPECT_FALSE(tab->is_valid());
+ scoped_refptr<TabProxy> tab(proxy->CreateTabWithHostWindow(false,
+ GURL(), &external_tab_container, &tab_wnd));
+
+ EXPECT_TRUE(tab->is_valid());
+ if (tab) {
+ // Enter a message loop to allow the tab to be created
+ proxy->WaitForNavigation(2000);
+ DoAdditionalPreNavigateSetup(tab.get());
+
+ // We explicitly do not make this a toolstrip in the extension manifest,
+ // so that the test can control when it gets loaded, and so that we test
+ // the intended behavior that tabs should be able to show extension pages
+ // (useful for development etc.)
+ tab->NavigateInExternalTab(url);
+ EXPECT_TRUE(proxy->WaitForMessage(action_max_timeout_ms()));
+
+ proxy->DestroyHostWindow();
+ proxy->WaitForTabCleanup(tab, action_max_timeout_ms());
+ EXPECT_FALSE(tab->is_valid());
+ }
}
// Override if you need additional stuff before we navigate the page.