| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "app/message_box_flags.h" | 5 #include "app/message_box_flags.h" |
| 6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
| 7 #include "base/platform_thread.h" | 7 #include "base/platform_thread.h" |
| 8 #include "chrome/browser/net/url_request_mock_http_job.h" | 8 #include "chrome/browser/net/url_request_mock_http_job.h" |
| 9 #include "chrome/browser/view_ids.h" | 9 #include "chrome/browser/view_ids.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 NavigateToNolistenersFileTwice(); | 276 NavigateToNolistenersFileTwice(); |
| 277 ASSERT_TRUE(IsBrowserRunning()); | 277 ASSERT_TRUE(IsBrowserRunning()); |
| 278 } | 278 } |
| 279 | 279 |
| 280 // Tests closing the browser on a page with no unload listeners registered. | 280 // Tests closing the browser on a page with no unload listeners registered. |
| 281 TEST_F(UnloadTest, SKIP_LINUX(BrowserCloseNoUnloadListeners)) { | 281 TEST_F(UnloadTest, SKIP_LINUX(BrowserCloseNoUnloadListeners)) { |
| 282 LoadUrlAndQuitBrowser(NOLISTENERS_HTML, L"nolisteners"); | 282 LoadUrlAndQuitBrowser(NOLISTENERS_HTML, L"nolisteners"); |
| 283 } | 283 } |
| 284 | 284 |
| 285 // Tests closing the browser on a page with an unload listener registered. | 285 // Tests closing the browser on a page with an unload listener registered. |
| 286 TEST_F(UnloadTest, SKIP_LINUX(BrowserCloseUnload)) { | 286 // Test marked as flaky in http://crbug.com/51698 |
| 287 TEST_F(UnloadTest, SKIP_LINUX(FLAKY_BrowserCloseUnload)) { |
| 287 LoadUrlAndQuitBrowser(UNLOAD_HTML, L"unload"); | 288 LoadUrlAndQuitBrowser(UNLOAD_HTML, L"unload"); |
| 288 } | 289 } |
| 289 | 290 |
| 290 // Tests closing the browser with a beforeunload handler and clicking | 291 // Tests closing the browser with a beforeunload handler and clicking |
| 291 // OK in the beforeunload confirm dialog. | 292 // OK in the beforeunload confirm dialog. |
| 292 TEST_F(UnloadTest, BrowserCloseBeforeUnloadOK) { | 293 TEST_F(UnloadTest, BrowserCloseBeforeUnloadOK) { |
| 293 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); | 294 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); |
| 294 ASSERT_TRUE(browser.get()); | 295 ASSERT_TRUE(browser.get()); |
| 295 NavigateToDataURL(BEFORE_UNLOAD_HTML, L"beforeunload"); | 296 NavigateToDataURL(BEFORE_UNLOAD_HTML, L"beforeunload"); |
| 296 | 297 |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_timeout_ms())); | 445 ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_timeout_ms())); |
| 445 scoped_refptr<TabProxy> main_tab(browser->GetActiveTab()); | 446 scoped_refptr<TabProxy> main_tab(browser->GetActiveTab()); |
| 446 ASSERT_TRUE(main_tab.get()); | 447 ASSERT_TRUE(main_tab.get()); |
| 447 std::wstring main_title; | 448 std::wstring main_title; |
| 448 EXPECT_TRUE(main_tab->GetTabTitle(&main_title)); | 449 EXPECT_TRUE(main_tab->GetTabTitle(&main_title)); |
| 449 EXPECT_EQ(std::wstring(L"only_one_unload"), main_title); | 450 EXPECT_EQ(std::wstring(L"only_one_unload"), main_title); |
| 450 } | 451 } |
| 451 | 452 |
| 452 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs | 453 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs |
| 453 // and multiple windows. | 454 // and multiple windows. |
| OLD | NEW |