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