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

Unified Diff: content/browser/site_instance_unittest.cc

Issue 7068007: Revise about: and chrome: url handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update special_tabs.py from Nirnimesh's codereview.chromium.org/6995057/. Created 9 years, 6 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/browser/site_instance.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/site_instance_unittest.cc
diff --git a/content/browser/site_instance_unittest.cc b/content/browser/site_instance_unittest.cc
index 8bda89e22ceaf78353da12b0df31bcab1d197099..6931e5aef9ff81c20e2d083a3cea83104fc342dd 100644
--- a/content/browser/site_instance_unittest.cc
+++ b/content/browser/site_instance_unittest.cc
@@ -24,10 +24,6 @@
namespace {
-// TODO(estade): this shouldn't need to be chrome:, but it does (or else GURL
-// doesn't think that the webui URLs have a host). Figure out where this is
-// coming from and fix it.
-const char kWebUIScheme[] = "chrome";
const char kSameAsAnyInstanceURL[] = "about:internets";
class SiteInstanceTestWebUIFactory : public content::EmptyWebUIFactory {
@@ -36,7 +32,7 @@ class SiteInstanceTestWebUIFactory : public content::EmptyWebUIFactory {
return HasWebUIScheme(url);
}
virtual bool HasWebUIScheme(const GURL& url) const {
- return url.SchemeIs(kWebUIScheme);
+ return url.SchemeIs(chrome::kChromeUIScheme);
}
};
@@ -47,7 +43,8 @@ class SiteInstanceTestBrowserClient : public content::ContentBrowserClient {
}
virtual bool IsURLSameAsAnySiteInstance(const GURL& url) OVERRIDE {
- return url.spec() == kSameAsAnyInstanceURL;
+ return url == GURL(kSameAsAnyInstanceURL) ||
+ url == GURL(chrome::kAboutCrashURL);
}
private:
@@ -492,14 +489,12 @@ TEST_F(SiteInstanceTest, ProcessSharingByType) {
extension2_instance->GetProcess());
// Create some WebUI instances and make sure they share a process.
- scoped_refptr<SiteInstance> webui1_instance(
- CreateSiteInstance(&rph_factory,
- GURL(kWebUIScheme + std::string("://newtab"))));
+ scoped_refptr<SiteInstance> webui1_instance(CreateSiteInstance(&rph_factory,
+ GURL(chrome::kChromeUIScheme + std::string("://newtab"))));
policy->GrantWebUIBindings(webui1_instance->GetProcess()->id());
- scoped_refptr<SiteInstance> webui2_instance(
- CreateSiteInstance(&rph_factory,
- GURL(kWebUIScheme + std::string("://history"))));
+ scoped_refptr<SiteInstance> webui2_instance( CreateSiteInstance(&rph_factory,
+ GURL(chrome::kChromeUIScheme + std::string("://history"))));
scoped_ptr<RenderProcessHost> dom_host(webui1_instance->GetProcess());
EXPECT_EQ(webui1_instance->GetProcess(), webui2_instance->GetProcess());
« no previous file with comments | « content/browser/site_instance.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698