diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 01:18:56 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 01:18:56 +0000 |
commit | d878bab389753cb876231717217a7e470b5a261f (patch) | |
tree | 1f806e2126df04174e396755994ad9f2eec87c7c /chrome/test/ui | |
parent | dcc8f1c678af98247adc7a056ace7e6c145ed189 (diff) | |
download | chromium_src-d878bab389753cb876231717217a7e470b5a261f.zip chromium_src-d878bab389753cb876231717217a7e470b5a261f.tar.gz chromium_src-d878bab389753cb876231717217a7e470b5a261f.tar.bz2 |
Bandaid patch so that we continue with crosssite navigations instead of closing the tab if the beforeunload /unload handler hangs. This patch does the right user-visible behavior, but I'm not a huge fan of the plumbing necessary to make it work. Totally open to cleanup suggestions.
There's also currently one bug that I haven't been able to pinpoint in the UI test. It only treats the first UI test of the four that I run as a cross-site navigation. No matter which test I run first. I wonder if there is some state I should be setting/clearing before/after each test run?
Also there's a DHECK that we hit that the UI test exposed. I 'm not sure it's a case that a user could actually hit though and it's not new with this code, so I added a TODO.
Can I get help from a mac person on adding the UI test to the xcode project?
BUG=3198
Review URL: http://codereview.chromium.org/8920
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui')
-rw-r--r-- | chrome/test/ui/ui_test.cc | 9 | ||||
-rw-r--r-- | chrome/test/ui/ui_test.h | 5 | ||||
-rw-r--r-- | chrome/test/ui/ui_tests.vcproj | 8 |
3 files changed, 22 insertions, 0 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 322f02c..f4371d2 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -342,6 +342,15 @@ TabProxy* UITest::GetActiveTab() { return window_proxy->GetTab(active_tab_index); } +void UITest::NavigateToURLAsync(const GURL& url) { + scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); + ASSERT_TRUE(tab_proxy.get()); + if (!tab_proxy.get()) + return; + + tab_proxy->NavigateToURLAsync(url); +} + void UITest::NavigateToURL(const GURL& url) { scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); ASSERT_TRUE(tab_proxy.get()); diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h index f575496..66a103c 100644 --- a/chrome/test/ui/ui_test.h +++ b/chrome/test/ui/ui_test.h @@ -67,6 +67,11 @@ class UITest : public testing::Test { // Exits out browser instance. void QuitBrowser(); + // Tells the browser to navigato to the givne URL in the active tab + // of the first app window. + // Does not wait for the navigation to complete to return. + void NavigateToURLAsync(const GURL& url); + // Tells the browser to navigate to the given URL in the active tab // of the first app window. // This method doesn't return until the navigation is complete. diff --git a/chrome/test/ui/ui_tests.vcproj b/chrome/test/ui/ui_tests.vcproj index 5bfe40e..067b232 100644 --- a/chrome/test/ui/ui_tests.vcproj +++ b/chrome/test/ui/ui_tests.vcproj @@ -323,6 +323,14 @@ </File> </Filter> <Filter + Name="TestUnload" + > + <File + RelativePath="..\..\browser\unload_uitest.cc" + > + </File> + </Filter> + <Filter Name="TestAuthentication" > <File |