OLD | NEW |
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 <stdint.h> | 5 #include <stdint.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 TestInterstitialPage* interstitial_page_; | 222 TestInterstitialPage* interstitial_page_; |
223 }; | 223 }; |
224 | 224 |
225 class WebContentsImplTestBrowserClient : public TestContentBrowserClient { | 225 class WebContentsImplTestBrowserClient : public TestContentBrowserClient { |
226 public: | 226 public: |
227 WebContentsImplTestBrowserClient() | 227 WebContentsImplTestBrowserClient() |
228 : assign_site_for_url_(false) {} | 228 : assign_site_for_url_(false) {} |
229 | 229 |
230 ~WebContentsImplTestBrowserClient() override {} | 230 ~WebContentsImplTestBrowserClient() override {} |
231 | 231 |
232 net::URLRequestContextGetter* CreateRequestContext( | |
233 BrowserContext* browser_context, | |
234 ProtocolHandlerMap* protocol_handlers, | |
235 URLRequestInterceptorScopedVector request_interceptors) override { | |
236 return static_cast<TestBrowserContext*>(browser_context)-> | |
237 GetRequestContext(); | |
238 } | |
239 | |
240 bool ShouldAssignSiteForURL(const GURL& url) override { | 232 bool ShouldAssignSiteForURL(const GURL& url) override { |
241 return assign_site_for_url_; | 233 return assign_site_for_url_; |
242 } | 234 } |
243 | 235 |
244 void set_assign_site_for_url(bool assign) { | 236 void set_assign_site_for_url(bool assign) { |
245 assign_site_for_url_ = assign; | 237 assign_site_for_url_ = assign; |
246 } | 238 } |
247 | 239 |
248 private: | 240 private: |
249 bool assign_site_for_url_; | 241 bool assign_site_for_url_; |
(...skipping 3198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3448 // An automatic navigation. | 3440 // An automatic navigation. |
3449 contents()->GetMainFrame()->SendNavigateWithModificationCallback( | 3441 contents()->GetMainFrame()->SendNavigateWithModificationCallback( |
3450 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); | 3442 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); |
3451 | 3443 |
3452 EXPECT_EQ(1u, dialog_manager.reset_count()); | 3444 EXPECT_EQ(1u, dialog_manager.reset_count()); |
3453 | 3445 |
3454 contents()->SetJavaScriptDialogManagerForTesting(nullptr); | 3446 contents()->SetJavaScriptDialogManagerForTesting(nullptr); |
3455 } | 3447 } |
3456 | 3448 |
3457 } // namespace content | 3449 } // namespace content |
OLD | NEW |