Restore previous null checks to ChromeContentBrowserClient.
BUG=164223
TEST=Start Chrome with --site-per-process or --enable-strict-site-isolation
Review URL: https://chromiumcodereview.appspot.com/11441004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@171294 0039d316-1c4b-4281-b951-d872f2087c98
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 @@
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