diff options
author | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-07 19:01:45 +0000 |
---|---|---|
committer | msw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-07 19:01:45 +0000 |
commit | 13ed8da1c7ca2564e5fb9ff624f7cdb80eb033f3 (patch) | |
tree | 4b52c701627cf62f3e0d5d6b0aa3273303ea523b /content/browser/site_instance_unittest.cc | |
parent | 1e42f714e94d85e2fcc2ee4eabdb6202291375ad (diff) | |
download | chromium_src-13ed8da1c7ca2564e5fb9ff624f7cdb80eb033f3.zip chromium_src-13ed8da1c7ca2564e5fb9ff624f7cdb80eb033f3.tar.gz chromium_src-13ed8da1c7ca2564e5fb9ff624f7cdb80eb033f3.tar.bz2 |
Revert 88142 to fix sync_integration_tests offline.
*Fixup about and chrome scheme URLs in URLFixerUpper::FixupURL.
*Update AboutSource to use the source_name of each about/chrome page.
*Make WillHandleBrowserAboutURL fix up schemes and handle chrome://foo/
-Redirect memory to memory-redirect (wasn't handling chrome://memory/).
-Catalog all kChromeUI*Hosts in url_constants.cc
-Simplify paths (credits, os-credits, ipc, settings, about/version).
-Nix web_ui_util::ChromeURLHostEquals (use scheme & host comparison).
-Favor GURL::SchemeIs and url_constants, update & expand tests.
-Add and fixup chrome://chrome-urls (the about:about page).
BUG=55771
TEST=Access about:, about://, chrome:, chrome:// pages.
Review URL: http://codereview.chromium.org/7068007
TBR=msw@chromium.org
Review URL: http://codereview.chromium.org/7064052
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88166 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/site_instance_unittest.cc')
-rw-r--r-- | content/browser/site_instance_unittest.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/content/browser/site_instance_unittest.cc b/content/browser/site_instance_unittest.cc index 6931e5a..8bda89e 100644 --- a/content/browser/site_instance_unittest.cc +++ b/content/browser/site_instance_unittest.cc @@ -24,6 +24,10 @@ 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 { @@ -32,7 +36,7 @@ class SiteInstanceTestWebUIFactory : public content::EmptyWebUIFactory { return HasWebUIScheme(url); } virtual bool HasWebUIScheme(const GURL& url) const { - return url.SchemeIs(chrome::kChromeUIScheme); + return url.SchemeIs(kWebUIScheme); } }; @@ -43,8 +47,7 @@ class SiteInstanceTestBrowserClient : public content::ContentBrowserClient { } virtual bool IsURLSameAsAnySiteInstance(const GURL& url) OVERRIDE { - return url == GURL(kSameAsAnyInstanceURL) || - url == GURL(chrome::kAboutCrashURL); + return url.spec() == kSameAsAnyInstanceURL; } private: @@ -489,12 +492,14 @@ 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(chrome::kChromeUIScheme + std::string("://newtab")))); + scoped_refptr<SiteInstance> webui1_instance( + CreateSiteInstance(&rph_factory, + GURL(kWebUIScheme + std::string("://newtab")))); policy->GrantWebUIBindings(webui1_instance->GetProcess()->id()); - scoped_refptr<SiteInstance> webui2_instance( CreateSiteInstance(&rph_factory, - GURL(chrome::kChromeUIScheme + std::string("://history")))); + scoped_refptr<SiteInstance> webui2_instance( + CreateSiteInstance(&rph_factory, + GURL(kWebUIScheme + std::string("://history")))); scoped_ptr<RenderProcessHost> dom_host(webui1_instance->GetProcess()); EXPECT_EQ(webui1_instance->GetProcess(), webui2_instance->GetProcess()); |