summaryrefslogtreecommitdiffstats
path: root/chrome/browser/unload_uitest.cc
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 21:18:33 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-27 21:18:33 +0000
commit9463788c6a3bfdc54f8d4ada196078e155e762d5 (patch)
treeb0d88bcd63023020b176dc4a757b9517f1198c36 /chrome/browser/unload_uitest.cc
parent4426cc1d6f644146385e80e1874d298ab8314f89 (diff)
downloadchromium_src-9463788c6a3bfdc54f8d4ada196078e155e762d5.zip
chromium_src-9463788c6a3bfdc54f8d4ada196078e155e762d5.tar.gz
chromium_src-9463788c6a3bfdc54f8d4ada196078e155e762d5.tar.bz2
Revert 48417 - More test enabling.
RedirectTest.ClientServerServer passes locally so I'm trying reenabling it. file a bug for RedirectTest.ClientCancelledByNewNavigationAfterProvisionalLoad . file a bug for SessionHistoryTest.CrossFrameFormBackForward mark SessionHistoryTest.LocationReplace as failing rather than disabled fix UnloadTest.BrowserCloseTabWhenOtherTabHasListener (the popup was being caught by the popup blocker) TEST=buildbots BUG=12913 Review URL: http://codereview.chromium.org/2264001 TBR=estade@chromium.org Looks like UnloadTest.BrowserCloseTabWhenOtherTabHasListener still unhappy on bot? http://buildbot.jail.google.com/buildbot/chromium/builders/XP%20Tests/builds/20319/steps/ui_tests/logs/stdio [----------] Global test environment tear-down [==========] 315 tests from 72 test cases ran. (1089094 ms total) [ PASSED ] 308 tests. [ FAILED ] 7 tests, listed below: [ FAILED ] MouseLeaveTest.FLAKY_TestOnMouseOut [ FAILED ] HistoryTester.FAILS_VerifyHistoryLength2 [ FAILED ] HistoryTester.FAILS_VerifyHistoryLength3 [ FAILED ] WorkerTest.FLAKY_WorkerHttpLayoutTests [ FAILED ] UnloadTest.BrowserCloseTabWhenOtherTabHasListener [ FAILED ] SessionHistoryTest.FAILS_LocationReplace [ FAILED ] SessionHistoryTest.FLAKY_HistorySearchXSS Review URL: http://codereview.chromium.org/2225009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/unload_uitest.cc')
-rw-r--r--chrome/browser/unload_uitest.cc57
1 files changed, 26 insertions, 31 deletions
diff --git a/chrome/browser/unload_uitest.cc b/chrome/browser/unload_uitest.cc
index ec1a58b..e0185c8 100644
--- a/chrome/browser/unload_uitest.cc
+++ b/chrome/browser/unload_uitest.cc
@@ -85,9 +85,9 @@ const std::string TWO_SECOND_BEFORE_UNLOAD_ALERT_HTML =
const std::string CLOSE_TAB_WHEN_OTHER_TAB_HAS_LISTENER =
"<html><head><title>only_one_unload</title></head>"
- "<body onclick=\"window.open('data:text/html,"
+ "<body onload=\"window.open('data:text/html,"
"<html><head><title>popup</title></head></body>')\" "
- "onbeforeunload='return;'>"
+ "onbeforeunload='return;'"
"</body></html>";
class UnloadTest : public UITest {
@@ -292,7 +292,6 @@ TEST_F(UnloadTest, BrowserCloseUnload) {
#define BrowserCloseWithInnerFocusedFrame \
DISABLED_BrowserCloseWithInnerFocusedFrame
#endif
-
// Tests closing the browser with a beforeunload handler and clicking
// OK in the beforeunload confirm dialog.
TEST_F(UnloadTest, BrowserCloseBeforeUnloadOK) {
@@ -397,46 +396,42 @@ TEST_F(UnloadTest, BrowserCloseTwoSecondBeforeUnloadAlert) {
L"twosecondbeforeunloadalert");
}
-#if defined(OS_MACOSX)
-// http://crbug.com/45162
-#define MAYBE_BrowserCloseTabWhenOtherTabHasListener \
- DISABLED_BrowserCloseTabWhenOtherTabHasListener
-#else
-#define MAYBE_BrowserCloseTabWhenOtherTabHasListener \
- BrowserCloseTabWhenOtherTabHasListener
-#endif
+// TODO(brettw) bug 12913 this test was broken by WebKit merge 42202:44252.
+// Apparently popup titles are broken somehow.
// Tests that if there's a renderer process with two tabs, one of which has an
// unload handler, and the other doesn't, the tab that doesn't have an unload
-// handler can be closed.
-TEST_F(UnloadTest, MAYBE_BrowserCloseTabWhenOtherTabHasListener) {
+// handler can be closed. If this test fails, the Close() call will hang.
+TEST_F(UnloadTest, DISABLED_BrowserCloseTabWhenOtherTabHasListener) {
NavigateToDataURL(CLOSE_TAB_WHEN_OTHER_TAB_HAS_LISTENER, L"only_one_unload");
-
- scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0);
- ASSERT_TRUE(browser.get());
- scoped_refptr<WindowProxy> window = browser->GetWindow();
- ASSERT_TRUE(window.get());
-
- gfx::Rect tab_view_bounds;
- ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_CONTAINER,
- &tab_view_bounds, true));
- // Simulate a click to force user_gesture to true; if we don't, the resulting
- // popup will be constrained, which isn't what we want to test.
- ASSERT_TRUE(window->SimulateOSClick(tab_view_bounds.CenterPoint(),
- views::Event::EF_LEFT_BUTTON_DOWN));
- ASSERT_TRUE(browser->WaitForTabCountToBecome(2, action_timeout_ms()));
-
- scoped_refptr<TabProxy> popup_tab(browser->GetActiveTab());
+ int window_count;
+ ASSERT_TRUE(automation()->GetBrowserWindowCount(&window_count));
+ ASSERT_EQ(2, window_count);
+
+ scoped_refptr<BrowserProxy> popup_browser_proxy(
+ automation()->GetBrowserWindow(1));
+ ASSERT_TRUE(popup_browser_proxy.get());
+ int popup_tab_count;
+ EXPECT_TRUE(popup_browser_proxy->GetTabCount(&popup_tab_count));
+ EXPECT_EQ(1, popup_tab_count);
+ scoped_refptr<TabProxy> popup_tab(popup_browser_proxy->GetActiveTab());
ASSERT_TRUE(popup_tab.get());
std::wstring popup_title;
+ ASSERT_TRUE(popup_tab.get() != NULL);
EXPECT_TRUE(popup_tab->GetTabTitle(&popup_title));
EXPECT_EQ(std::wstring(L"popup"), popup_title);
EXPECT_TRUE(popup_tab->Close(true));
- ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_timeout_ms()));
- scoped_refptr<TabProxy> main_tab(browser->GetActiveTab());
+ scoped_refptr<BrowserProxy> main_browser_proxy(
+ automation()->GetBrowserWindow(0));
+ ASSERT_TRUE(main_browser_proxy.get());
+ int main_tab_count;
+ EXPECT_TRUE(main_browser_proxy->GetTabCount(&main_tab_count));
+ EXPECT_EQ(1, main_tab_count);
+ scoped_refptr<TabProxy> main_tab(main_browser_proxy->GetActiveTab());
ASSERT_TRUE(main_tab.get());
std::wstring main_title;
+ ASSERT_TRUE(main_tab.get() != NULL);
EXPECT_TRUE(main_tab->GetTabTitle(&main_title));
EXPECT_EQ(std::wstring(L"only_one_unload"), main_title);
}