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

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 10080018: Don't allow sending data URLs to WebUI, unless in a ChromeOS BalloonHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile errors and crash in tests. Created 8 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 | Annotate | Revision Log
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 "base/logging.h" 5 #include "base/logging.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "content/browser/mock_content_browser_client.h" 7 #include "content/browser/mock_content_browser_client.h"
8 #include "content/browser/renderer_host/render_view_host_impl.h" 8 #include "content/browser/renderer_host/render_view_host_impl.h"
9 #include "content/browser/renderer_host/test_render_view_host.h" 9 #include "content/browser/renderer_host/test_render_view_host.h"
10 #include "content/browser/site_instance_impl.h" 10 #include "content/browser/site_instance_impl.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 const GURL& url) const OVERRIDE { 68 const GURL& url) const OVERRIDE {
69 return content::GetContentClient()->HasWebUIScheme(url); 69 return content::GetContentClient()->HasWebUIScheme(url);
70 } 70 }
71 71
72 virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, 72 virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context,
73 const GURL& url) const OVERRIDE { 73 const GURL& url) const OVERRIDE {
74 return content::GetContentClient()->HasWebUIScheme(url); 74 return content::GetContentClient()->HasWebUIScheme(url);
75 } 75 }
76 76
77 virtual bool IsURLAcceptableForWebUI( 77 virtual bool IsURLAcceptableForWebUI(
78 BrowserContext* browser_context, const GURL& url) const { 78 BrowserContext* browser_context,
79 const GURL& url,
80 bool data_urls_allowed) const {
79 return content::GetContentClient()->HasWebUIScheme(url); 81 return content::GetContentClient()->HasWebUIScheme(url);
80 } 82 }
81 }; 83 };
82 84
83 class WebContentsImplTestContentClient : public TestContentClient { 85 class WebContentsImplTestContentClient : public TestContentClient {
84 public: 86 public:
85 WebContentsImplTestContentClient() { 87 WebContentsImplTestContentClient() {
86 } 88 }
87 89
88 virtual bool HasWebUIScheme(const GURL& url) const OVERRIDE { 90 virtual bool HasWebUIScheme(const GURL& url) const OVERRIDE {
(...skipping 1842 matching lines...) Expand 10 before | Expand all | Expand 10 after
1931 // It should have a transient entry. 1933 // It should have a transient entry.
1932 EXPECT_TRUE(other_controller.GetTransientEntry()); 1934 EXPECT_TRUE(other_controller.GetTransientEntry());
1933 1935
1934 // And the interstitial should be showing. 1936 // And the interstitial should be showing.
1935 EXPECT_TRUE(other_contents->ShowingInterstitialPage()); 1937 EXPECT_TRUE(other_contents->ShowingInterstitialPage());
1936 1938
1937 // And the interstitial should do a reload on don't proceed. 1939 // And the interstitial should do a reload on don't proceed.
1938 EXPECT_TRUE(static_cast<InterstitialPageImpl*>( 1940 EXPECT_TRUE(static_cast<InterstitialPageImpl*>(
1939 other_contents->GetInterstitialPage())->reload_on_dont_proceed()); 1941 other_contents->GetInterstitialPage())->reload_on_dont_proceed());
1940 } 1942 }
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/public/browser/web_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698