diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chrome_content_browser_client.cc | 8 | ||||
-rw-r--r-- | chrome/browser/chrome_content_browser_client_browsertest.cc | 19 |
2 files changed, 23 insertions, 4 deletions
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index eadba8b..a188c1c 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -635,7 +635,7 @@ GURL ChromeContentBrowserClient::GetEffectiveURL( // installed app, the effective URL is an extension URL with the ID of that // extension as the host. This has the effect of grouping apps together in // a common SiteInstance. - ExtensionService* extension_service = + ExtensionService* extension_service = !profile ? NULL : extensions::ExtensionSystem::Get(profile)->extension_service(); if (!extension_service) return url; @@ -664,7 +664,7 @@ bool ChromeContentBrowserClient::ShouldUseProcessPerSite( return false; Profile* profile = Profile::FromBrowserContext(browser_context); - ExtensionService* extension_service = + ExtensionService* extension_service = !profile ? NULL : extensions::ExtensionSystem::Get(profile)->extension_service(); if (!extension_service) return false; @@ -736,7 +736,7 @@ bool ChromeContentBrowserClient::ShouldTryToUseExistingProcessHost( return false; Profile* profile = Profile::FromBrowserContext(browser_context); - ExtensionService* service = + ExtensionService* service = !profile ? NULL : extensions::ExtensionSystem::Get(profile)->extension_service(); if (!service) return false; @@ -1789,7 +1789,7 @@ bool ChromeContentBrowserClient::AllowPepperSocketAPI( Profile* profile = Profile::FromBrowserContext(browser_context); const Extension* extension = NULL; - ExtensionService* extension_service = + ExtensionService* extension_service = !profile ? NULL : extensions::ExtensionSystem::Get(profile)->extension_service(); if (extension_service) { extension = extension_service->extensions()-> diff --git a/chrome/browser/chrome_content_browser_client_browsertest.cc b/chrome/browser/chrome_content_browser_client_browsertest.cc index 4a4f230..3af0126 100644 --- a/chrome/browser/chrome_content_browser_client_browsertest.cc +++ b/chrome/browser/chrome_content_browser_client_browsertest.cc @@ -4,6 +4,7 @@ #include <string> +#include "base/command_line.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/tab_contents/tab_contents.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" @@ -12,6 +13,7 @@ #include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_entry.h" #include "content/public/browser/web_contents.h" +#include "content/public/common/content_switches.h" #include "googleurl/src/gurl.h" namespace content { @@ -64,4 +66,21 @@ IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest, EXPECT_EQ(url, entry->GetVirtualURL()); } +// Test that a basic navigation works in --site-per-process mode. This prevents +// regressions when that mode calls out into the ChromeContentBrowserClient, +// such as http://crbug.com/164223. +IN_PROC_BROWSER_TEST_F(ChromeContentBrowserClientBrowserTest, + SitePerProcessNavigation) { + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kSitePerProcess); + const GURL url(std::string("chrome://chrome/")); + + ui_test_utils::NavigateToURL(browser(), url); + NavigationEntry* entry = GetLastCommittedEntry(); + + ASSERT_TRUE(entry != NULL); + EXPECT_EQ(url, entry->GetURL()); + EXPECT_EQ(url, entry->GetVirtualURL()); +} + } // namespace content |