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

Unified Diff: content/renderer/render_view_browsertest.cc

Issue 11819050: Revert 175890: actually, looks like we want this to also help move chromeos webui pages out of src/… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/common/url_constants.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_browsertest.cc
===================================================================
--- content/renderer/render_view_browsertest.cc (revision 175970)
+++ content/renderer/render_view_browsertest.cc (working copy)
@@ -96,11 +96,11 @@
}
virtual bool UseWebUIForURL(BrowserContext* browser_context,
const GURL& url) const OVERRIDE {
- return GetContentClient()->HasWebUIScheme(url);
+ return HasWebUIScheme(url);
}
virtual bool UseWebUIBindingsForURL(BrowserContext* browser_context,
const GURL& url) const OVERRIDE {
- return GetContentClient()->HasWebUIScheme(url);
+ return HasWebUIScheme(url);
}
virtual bool IsURLAcceptableForWebUI(
BrowserContext* browser_context,
@@ -110,28 +110,6 @@
}
};
-class WebUITestClient : public ShellContentClient {
- public:
- WebUITestClient() {
- }
-
- virtual bool HasWebUIScheme(const GURL& url) const OVERRIDE {
- return url.SchemeIs(chrome::kChromeUIScheme);
- }
-};
-
-class WebUITestBrowserClient : public ShellContentBrowserClient {
- public:
- WebUITestBrowserClient() {}
-
- virtual WebUIControllerFactory* GetWebUIControllerFactory() OVERRIDE {
- return &factory_;
- }
-
- private:
- WebUITestWebUIControllerFactory factory_;
-};
-
} // namespace
class RenderViewImplTest : public RenderViewTest {
@@ -342,15 +320,9 @@
}
TEST_F(RenderViewImplTest, DecideNavigationPolicy) {
- WebUITestClient client;
- WebUITestBrowserClient browser_client;
- ContentClient* old_client = GetContentClient();
- ContentBrowserClient* old_browser_client = GetContentClient()->browser();
+ WebUITestWebUIControllerFactory factory;
+ WebUIControllerFactory::RegisterFactory(&factory);
- SetContentClient(&client);
- GetContentClient()->set_browser_for_testing(&browser_client);
- client.set_renderer_for_testing(old_client->renderer());
-
// Navigations to normal HTTP URLs can be handled locally.
WebKit::WebURLRequest request(GURL("http://foo.com"));
WebKit::WebNavigationPolicy policy = view()->decidePolicyForNavigation(
@@ -384,9 +356,6 @@
WebKit::WebNavigationPolicyNewForegroundTab,
false);
EXPECT_EQ(WebKit::WebNavigationPolicyIgnore, policy);
-
- GetContentClient()->set_browser_for_testing(old_browser_client);
- SetContentClient(old_client);
}
TEST_F(RenderViewImplTest, DecideNavigationPolicyForWebUI) {
« no previous file with comments | « content/public/common/url_constants.cc ('k') | content/renderer/render_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698