Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(486)

Side by Side Diff: content/public/test/test_navigation_observer.cc

Issue 2702503002: Block renderer-initiated main frame navigations to data URLs (Closed)
Patch Set: Fix Android PDF tests where PDFs should be downloaded Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/public/common/content_features.cc ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/test/test_navigation_observer.h" 5 #include "content/public/test/test_navigation_observer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "content/browser/web_contents/web_contents_impl.h" 9 #include "content/browser/web_contents/web_contents_impl.h"
10 #include "content/public/browser/navigation_handle.h" 10 #include "content/public/browser/navigation_handle.h"
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 DISALLOW_COPY_AND_ASSIGN(TestWebContentsObserver); 64 DISALLOW_COPY_AND_ASSIGN(TestWebContentsObserver);
65 }; 65 };
66 66
67 TestNavigationObserver::TestNavigationObserver( 67 TestNavigationObserver::TestNavigationObserver(
68 WebContents* web_contents, 68 WebContents* web_contents,
69 int number_of_navigations, 69 int number_of_navigations,
70 MessageLoopRunner::QuitMode quit_mode) 70 MessageLoopRunner::QuitMode quit_mode)
71 : navigation_started_(false), 71 : navigation_started_(false),
72 navigations_completed_(0), 72 navigations_completed_(0),
73 number_of_navigations_(number_of_navigations), 73 number_of_navigations_(number_of_navigations),
74 last_navigation_succeeded_(false),
74 message_loop_runner_(new MessageLoopRunner(quit_mode)), 75 message_loop_runner_(new MessageLoopRunner(quit_mode)),
75 web_contents_created_callback_( 76 web_contents_created_callback_(
76 base::Bind(&TestNavigationObserver::OnWebContentsCreated, 77 base::Bind(&TestNavigationObserver::OnWebContentsCreated,
77 base::Unretained(this))) { 78 base::Unretained(this))) {
78 if (web_contents) 79 if (web_contents)
79 RegisterAsObserver(web_contents); 80 RegisterAsObserver(web_contents);
80 } 81 }
81 82
82 TestNavigationObserver::TestNavigationObserver( 83 TestNavigationObserver::TestNavigationObserver(
83 WebContents* web_contents, 84 WebContents* web_contents,
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 last_navigation_succeeded_ = false; 155 last_navigation_succeeded_ = false;
155 } 156 }
156 157
157 void TestNavigationObserver::OnDidFinishNavigation(bool is_error_page, 158 void TestNavigationObserver::OnDidFinishNavigation(bool is_error_page,
158 const GURL& url) { 159 const GURL& url) {
159 last_navigation_url_ = url; 160 last_navigation_url_ = url;
160 last_navigation_succeeded_ = !is_error_page; 161 last_navigation_succeeded_ = !is_error_page;
161 } 162 }
162 163
163 } // namespace content 164 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_features.cc ('k') | content/renderer/render_frame_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698