| 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 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 399 |
| 400 #if defined(OS_MACOSX) | 400 #if defined(OS_MACOSX) |
| 401 // http://crbug.com/45162 | 401 // http://crbug.com/45162 |
| 402 #define MAYBE_BrowserCloseTabWhenOtherTabHasListener \ | 402 #define MAYBE_BrowserCloseTabWhenOtherTabHasListener \ |
| 403 DISABLED_BrowserCloseTabWhenOtherTabHasListener | 403 DISABLED_BrowserCloseTabWhenOtherTabHasListener |
| 404 #elif defined(OS_WIN) | 404 #elif defined(OS_WIN) |
| 405 // http://crbug.com/45281 | 405 // http://crbug.com/45281 |
| 406 #define MAYBE_BrowserCloseTabWhenOtherTabHasListener \ | 406 #define MAYBE_BrowserCloseTabWhenOtherTabHasListener \ |
| 407 DISABLED_BrowserCloseTabWhenOtherTabHasListener | 407 DISABLED_BrowserCloseTabWhenOtherTabHasListener |
| 408 #else | 408 #else |
| 409 // Flaky on Linux as well. http://crbug.com/45562 |
| 409 #define MAYBE_BrowserCloseTabWhenOtherTabHasListener \ | 410 #define MAYBE_BrowserCloseTabWhenOtherTabHasListener \ |
| 410 BrowserCloseTabWhenOtherTabHasListener | 411 FLAKY_BrowserCloseTabWhenOtherTabHasListener |
| 411 #endif | 412 #endif |
| 412 | 413 |
| 413 // Tests that if there's a renderer process with two tabs, one of which has an | 414 // Tests that if there's a renderer process with two tabs, one of which has an |
| 414 // unload handler, and the other doesn't, the tab that doesn't have an unload | 415 // unload handler, and the other doesn't, the tab that doesn't have an unload |
| 415 // handler can be closed. | 416 // handler can be closed. |
| 416 TEST_F(UnloadTest, MAYBE_BrowserCloseTabWhenOtherTabHasListener) { | 417 TEST_F(UnloadTest, MAYBE_BrowserCloseTabWhenOtherTabHasListener) { |
| 417 NavigateToDataURL(CLOSE_TAB_WHEN_OTHER_TAB_HAS_LISTENER, L"only_one_unload"); | 418 NavigateToDataURL(CLOSE_TAB_WHEN_OTHER_TAB_HAS_LISTENER, L"only_one_unload"); |
| 418 | 419 |
| 419 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0); | 420 scoped_refptr<BrowserProxy> browser = automation()->GetBrowserWindow(0); |
| 420 ASSERT_TRUE(browser.get()); | 421 ASSERT_TRUE(browser.get()); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 440 ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_timeout_ms())); | 441 ASSERT_TRUE(browser->WaitForTabCountToBecome(1, action_timeout_ms())); |
| 441 scoped_refptr<TabProxy> main_tab(browser->GetActiveTab()); | 442 scoped_refptr<TabProxy> main_tab(browser->GetActiveTab()); |
| 442 ASSERT_TRUE(main_tab.get()); | 443 ASSERT_TRUE(main_tab.get()); |
| 443 std::wstring main_title; | 444 std::wstring main_title; |
| 444 EXPECT_TRUE(main_tab->GetTabTitle(&main_title)); | 445 EXPECT_TRUE(main_tab->GetTabTitle(&main_title)); |
| 445 EXPECT_EQ(std::wstring(L"only_one_unload"), main_title); | 446 EXPECT_EQ(std::wstring(L"only_one_unload"), main_title); |
| 446 } | 447 } |
| 447 | 448 |
| 448 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs | 449 // TODO(ojan): Add tests for unload/beforeunload that have multiple tabs |
| 449 // and multiple windows. | 450 // and multiple windows. |
| OLD | NEW |