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

Side by Side Diff: content/browser/web_contents/render_view_host_manager_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/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "content/browser/browser_thread_impl.h" 6 #include "content/browser/browser_thread_impl.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/test_render_view_host.h" 8 #include "content/browser/renderer_host/test_render_view_host.h"
9 #include "content/browser/site_instance_impl.h" 9 #include "content/browser/site_instance_impl.h"
10 #include "content/browser/web_contents/navigation_entry_impl.h" 10 #include "content/browser/web_contents/navigation_entry_impl.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 virtual bool UseWebUIForURL(BrowserContext* browser_context, 77 virtual bool UseWebUIForURL(BrowserContext* browser_context,
78 const GURL& url) const OVERRIDE { 78 const GURL& url) const OVERRIDE {
79 return content::GetContentClient()->HasWebUIScheme(url); 79 return content::GetContentClient()->HasWebUIScheme(url);
80 } 80 }
81 81
82 virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context, 82 virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context,
83 const GURL& url) const OVERRIDE { 83 const GURL& url) const OVERRIDE {
84 return content::GetContentClient()->HasWebUIScheme(url); 84 return content::GetContentClient()->HasWebUIScheme(url);
85 } 85 }
86 86
87 virtual bool IsURLAcceptableForWebUI(BrowserContext* browser_context, 87 virtual bool IsURLAcceptableForWebUI(
88 const GURL& url) const OVERRIDE { 88 BrowserContext* browser_context,
89 const GURL& url,
90 bool data_urls_allowed) const OVERRIDE {
89 return false; 91 return false;
90 } 92 }
91 93
92 private: 94 private:
93 bool should_create_webui_; 95 bool should_create_webui_;
94 96
95 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManagerTestWebUIControllerFactory); 97 DISALLOW_COPY_AND_ASSIGN(RenderViewHostManagerTestWebUIControllerFactory);
96 }; 98 };
97 99
98 class RenderViewHostManagerTestClient : public TestContentClient { 100 class RenderViewHostManagerTestClient : public TestContentClient {
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 765
764 // We should be able to navigate forward. 766 // We should be able to navigate forward.
765 contents()->GetController().GoForward(); 767 contents()->GetController().GoForward();
766 contents()->ProceedWithCrossSiteNavigation(); 768 contents()->ProceedWithCrossSiteNavigation();
767 const NavigationEntry* entry2 = contents()->GetController().GetPendingEntry(); 769 const NavigationEntry* entry2 = contents()->GetController().GetPendingEntry();
768 rvh2->SendNavigate(entry2->GetPageID(), entry2->GetURL()); 770 rvh2->SendNavigate(entry2->GetPageID(), entry2->GetURL());
769 EXPECT_EQ(rvh2, rvh()); 771 EXPECT_EQ(rvh2, rvh());
770 EXPECT_FALSE(rvh2->is_swapped_out()); 772 EXPECT_FALSE(rvh2->is_swapped_out());
771 EXPECT_TRUE(rvh1->is_swapped_out()); 773 EXPECT_TRUE(rvh1->is_swapped_out());
772 } 774 }
OLDNEW
« no previous file with comments | « content/browser/web_contents/render_view_host_manager.cc ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698