summaryrefslogtreecommitdiffstats
path: root/chrome/test/ui
diff options
context:
space:
mode:
authorojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 01:14:00 +0000
committerojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-12-17 01:14:00 +0000
commit3f97e3fbaee75e0ed70c1f37d195aef9914b20ee (patch)
tree1fd180ee8394534155f705a50e04edd7846fdb01 /chrome/test/ui
parenta1a3db8ce5e32f1069042aa64448a7862ced7d86 (diff)
downloadchromium_src-3f97e3fbaee75e0ed70c1f37d195aef9914b20ee.zip
chromium_src-3f97e3fbaee75e0ed70c1f37d195aef9914b20ee.tar.gz
chromium_src-3f97e3fbaee75e0ed70c1f37d195aef9914b20ee.tar.bz2
Add some initial before unload tests. We still need tests
for multiple tabs with beforeunload/unload handlers. Review URL: http://codereview.chromium.org/14085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7122 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/ui')
-rw-r--r--chrome/test/ui/ui_test.cc5
-rw-r--r--chrome/test/ui/ui_test.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index c3f0c4b..fbf03f9 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -570,6 +570,11 @@ std::wstring UITest::GetDownloadDirectory() {
return download_directory;
}
+void UITest::CloseBrowserAsync(BrowserProxy* browser) const {
+ server_->Send(
+ new AutomationMsg_CloseBrowserRequest(0, browser->handle()));
+}
+
bool UITest::CloseBrowser(BrowserProxy* browser,
bool* application_closed) const {
DCHECK(application_closed);
diff --git a/chrome/test/ui/ui_test.h b/chrome/test/ui/ui_test.h
index 4b9bf600..8a6aa0a 100644
--- a/chrome/test/ui/ui_test.h
+++ b/chrome/test/ui/ui_test.h
@@ -142,6 +142,11 @@ class UITest : public testing::Test {
bool WaitForBookmarkBarVisibilityChange(BrowserProxy* browser,
bool wait_for_open);
+ // Sends the request to close the browser without blocking.
+ // This is so we can interact with dialogs opened on browser close,
+ // e.g. the beforeunload confirm dialog.
+ void CloseBrowserAsync(BrowserProxy* browser) const;
+
// Closes the specified browser. Returns true if the browser was closed.
// This call is blocking. |application_closed| is set to true if this was
// the last browser window (and therefore as a result of it closing the