| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 | 74 |
| 75 class CloseObserver : public content::WebContentsObserver { | 75 class CloseObserver : public content::WebContentsObserver { |
| 76 public: | 76 public: |
| 77 explicit CloseObserver(WebContents* contents) | 77 explicit CloseObserver(WebContents* contents) |
| 78 : content::WebContentsObserver(contents) {} | 78 : content::WebContentsObserver(contents) {} |
| 79 | 79 |
| 80 void Wait() { | 80 void Wait() { |
| 81 close_loop_.Run(); | 81 close_loop_.Run(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 virtual void WebContentsDestroyed(WebContents* contents) OVERRIDE { | 84 virtual void WebContentsDestroyed() OVERRIDE { |
| 85 close_loop_.Quit(); | 85 close_loop_.Quit(); |
| 86 } | 86 } |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 base::RunLoop close_loop_; | 89 base::RunLoop close_loop_; |
| 90 | 90 |
| 91 DISALLOW_COPY_AND_ASSIGN(CloseObserver); | 91 DISALLOW_COPY_AND_ASSIGN(CloseObserver); |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 class PopupBlockerBrowserTest : public InProcessBrowserTest { | 94 class PopupBlockerBrowserTest : public InProcessBrowserTest { |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 | 471 |
| 472 // Verify that the renderer can't DOS the browser by creating arbitrarily many | 472 // Verify that the renderer can't DOS the browser by creating arbitrarily many |
| 473 // popups. | 473 // popups. |
| 474 IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, DenialOfService) { | 474 IN_PROC_BROWSER_TEST_F(PopupBlockerBrowserTest, DenialOfService) { |
| 475 GURL url(embedded_test_server()->GetURL("/popup_blocker/popup-dos.html")); | 475 GURL url(embedded_test_server()->GetURL("/popup_blocker/popup-dos.html")); |
| 476 ui_test_utils::NavigateToURL(browser(), url); | 476 ui_test_utils::NavigateToURL(browser(), url); |
| 477 ASSERT_EQ(25, GetBlockedContentsCount()); | 477 ASSERT_EQ(25, GetBlockedContentsCount()); |
| 478 } | 478 } |
| 479 | 479 |
| 480 } // namespace | 480 } // namespace |
| OLD | NEW |