| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 switches::kDisablePopupBlocking); | 331 switches::kDisablePopupBlocking); |
| 332 GURL url( | 332 GURL url( |
| 333 embedded_test_server()->GetURL("/popup_blocker/popup-on-unload.html")); | 333 embedded_test_server()->GetURL("/popup_blocker/popup-on-unload.html")); |
| 334 ui_test_utils::NavigateToURL(browser(), url); | 334 ui_test_utils::NavigateToURL(browser(), url); |
| 335 | 335 |
| 336 NavigateAndCheckPopupShown(embedded_test_server()->GetURL("/popup_blocker/"), | 336 NavigateAndCheckPopupShown(embedded_test_server()->GetURL("/popup_blocker/"), |
| 337 ExpectPopup); | 337 ExpectPopup); |
| 338 } | 338 } |
| 339 | 339 |
| 340 // Verify that when you unblock popup, the popup shows in history and omnibox. | 340 // Verify that when you unblock popup, the popup shows in history and omnibox. |
| 341 // TODO(crbug.com/663333) Flaky on Linux. |
| 342 #if defined(OS_LINUX) |
| 343 #define MAYBE_UnblockedPopupShowsInHistoryAndOmnibox \ |
| 344 DISABLED_UnblockedPopupShowsInHistoryAndOmnibox |
| 345 #else |
| 346 #define MAYBE_UnblockedPopupShowsInHistoryAndOmnibox \ |
| 347 UnblockedPopupShowsInHistoryAndOmnibox |
| 348 #endif |
| 341 IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, | 349 IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, |
| 342 UnblockedPopupShowsInHistoryAndOmnibox) { | 350 MAYBE_UnblockedPopupShowsInHistoryAndOmnibox) { |
| 343 base::CommandLine::ForCurrentProcess()->AppendSwitch( | 351 base::CommandLine::ForCurrentProcess()->AppendSwitch( |
| 344 switches::kDisablePopupBlocking); | 352 switches::kDisablePopupBlocking); |
| 345 GURL url(embedded_test_server()->GetURL( | 353 GURL url(embedded_test_server()->GetURL( |
| 346 "/popup_blocker/popup-blocked-to-post-blank.html")); | 354 "/popup_blocker/popup-blocked-to-post-blank.html")); |
| 347 NavigateAndCheckPopupShown(url, ExpectTab); | 355 NavigateAndCheckPopupShown(url, ExpectTab); |
| 348 | 356 |
| 349 std::string search_string = | 357 std::string search_string = |
| 350 "data:text/html,<title>Popup Success!</title>you should not see this " | 358 "data:text/html,<title>Popup Success!</title>you should not see this " |
| 351 "message if popup blocker is enabled"; | 359 "message if popup blocker is enabled"; |
| 352 | 360 |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 | 709 |
| 702 wait_for_new_tab.Wait(); | 710 wait_for_new_tab.Wait(); |
| 703 | 711 |
| 704 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); | 712 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile())); |
| 705 ASSERT_EQ(2, browser()->tab_strip_model()->count()); | 713 ASSERT_EQ(2, browser()->tab_strip_model()->count()); |
| 706 // Check that we create the background tab. | 714 // Check that we create the background tab. |
| 707 ASSERT_EQ(0, browser()->tab_strip_model()->active_index()); | 715 ASSERT_EQ(0, browser()->tab_strip_model()->active_index()); |
| 708 } | 716 } |
| 709 | 717 |
| 710 } // namespace | 718 } // namespace |
| OLD | NEW |