diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 23:03:32 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 23:03:32 +0000 |
commit | 51afbeda5420a5ffe4b2481181450388ea019975 (patch) | |
tree | db6effb2b158b75f6af7995a8aab57e7a30efa7c /chrome/browser/browser_uitest.cc | |
parent | 0a0ed3fed8087979a870721eced93aeca5ddbe28 (diff) | |
download | chromium_src-51afbeda5420a5ffe4b2481181450388ea019975.zip chromium_src-51afbeda5420a5ffe4b2481181450388ea019975.tar.gz chromium_src-51afbeda5420a5ffe4b2481181450388ea019975.tar.bz2 |
Move to using data URLs for unload tests and generally
cleanup the unload tests in preparation for adding
in tests for beforeunload.
Review URL: http://codereview.chromium.org/14017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6839 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_uitest.cc')
-rw-r--r-- | chrome/browser/browser_uitest.cc | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/chrome/browser/browser_uitest.cc b/chrome/browser/browser_uitest.cc index 740b2ea..e6a5033e 100644 --- a/chrome/browser/browser_uitest.cc +++ b/chrome/browser/browser_uitest.cc @@ -47,20 +47,6 @@ class BrowserTest : public UITest { ::GetWindowText(window_handle, WriteInto(&result, length), length); return result; } - - void LoadUnloadPageAndQuitBrowser(const std::wstring& test_filename) { - scoped_ptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); - - std::wstring test_file = test_data_directory_; - file_util::AppendToPath(&test_file, L"unload"); - file_util::AppendToPath(&test_file, test_filename); - - NavigateToURL(net::FilePathToFileURL(test_file)); - Sleep(kWaitForActionMsec); - - bool application_closed = false; - EXPECT_TRUE(CloseBrowser(browser.get(), &application_closed)); - } }; class VisibleBrowserTest : public UITest { @@ -99,39 +85,6 @@ TEST_F(BrowserTest, Title) { EXPECT_EQ(test_title, GetActiveTabTitle()); } -// Tests closing the browser on a page with no unload listeners registered. -TEST_F(BrowserTest, BrowserCloseNoUnloadListeners) { - LoadUnloadPageAndQuitBrowser(L"nolisteners.html"); -} - -// Tests closing the browser on a page with an unload listener registered. -TEST_F(BrowserTest, BrowserCloseUnload) { - LoadUnloadPageAndQuitBrowser(L"unload.html"); -} - -// Tests closing the browser on a page with an unload listener registered where -// the unload handler has an infinite loop. -TEST_F(BrowserTest, BrowserCloseUnloadLooping) { - LoadUnloadPageAndQuitBrowser(L"unloadlooping.html"); -} - -// Tests closing the browser on a page with an unload listener registered where -// the unload handler has an infinite loop followed by an alert. -TEST_F(BrowserTest, BrowserCloseUnloadLoopingAlert) { - LoadUnloadPageAndQuitBrowser(L"unloadloopingalert.html"); -} - -// Tests closing the browser on a page with an unload listener registered where -// the unload handler has an 2 second long loop followed by an alert. -TEST_F(BrowserTest, BrowserCloseUnloadLoopingTwoSecondsAlert) { - LoadUnloadPageAndQuitBrowser(L"unloadloopingtwosecondsalert.html"); -} - -// TODO(ojan): Test popping up an alert in the unload handler and test -// beforeunload. In addition add tests where we open all of these pages -// in the browser and then close it, as well as having two windows and -// closing only one of them. - // The browser should quit quickly if it receives a WM_ENDSESSION message. TEST_F(BrowserTest, WindowsSessionEnd) { std::wstring test_file = test_data_directory_; |