Index: chrome/browser/profiles/host_zoom_map_browsertest.cc |
diff --git a/chrome/browser/profiles/host_zoom_map_browsertest.cc b/chrome/browser/profiles/host_zoom_map_browsertest.cc |
index c4f5730d211b808742e8998a85e12f5a1d2cc0c9..9294891562431abf5624d2f288fcfcb65e8fb9cb 100644 |
--- a/chrome/browser/profiles/host_zoom_map_browsertest.cc |
+++ b/chrome/browser/profiles/host_zoom_map_browsertest.cc |
@@ -238,8 +238,43 @@ IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest, ZoomEventsWorkForOffTheRecord) { |
test_scheme, test_host)); |
} |
+#if defined(OS_CHROMEOS) |
Charlie Reis
2015/03/11 20:23:10
You need a comment that explains why this is disab
wjmaclean
2015/03/23 15:31:52
Let's force the test to run for ChromeOS, but chec
|
+#define MAYBE_WebviewBasedSigninUsesDefaultStoragePartitionForEmbedder \ |
+ DISABLED_WebviewBasedSigninUsesDefaultStoragePartitionForEmbedder |
+#else |
+#define MAYBE_WebviewBasedSigninUsesDefaultStoragePartitionForEmbedder \ |
+ WebviewBasedSigninUsesDefaultStoragePartitionForEmbedder |
+#endif |
+IN_PROC_BROWSER_TEST_F( |
+ HostZoomMapBrowserTest, |
+ MAYBE_WebviewBasedSigninUsesDefaultStoragePartitionForEmbedder) { |
+ GURL test_url = ConstructTestServerURL(chrome::kChromeUIChromeSigninURL); |
+ std::string test_host(test_url.host()); |
+ std::string test_scheme(test_url.scheme()); |
+ ui_test_utils::NavigateToURL(browser(), test_url); |
+ |
+ content::WebContents* web_contents = |
+ browser()->tab_strip_model()->GetActiveWebContents(); |
+ |
+ HostZoomMap* host_zoom_map = HostZoomMap::GetForWebContents(web_contents); |
+ |
+ // For the webview based sign-in code, the sign in page uses the default host |
+ // zoom map. |
+ HostZoomMap* default_profile_host_zoom_map = |
+ HostZoomMap::GetDefaultForBrowserContext(browser()->profile()); |
+ EXPECT_TRUE(switches::IsEnableWebviewBasedSignin()); |
+ EXPECT_EQ(host_zoom_map, default_profile_host_zoom_map); |
+} |
+ |
+class HostZoomMapIframeSigninBrowserTest : public HostZoomMapBrowserTest { |
+ public: |
+ void SetUpCommandLine(base::CommandLine* command_line) override { |
+ switches::EnableIframeBasedSigninForTesting(command_line); |
+ } |
+}; |
+ |
// Regression test for crbug.com/435017. |
-IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest, |
+IN_PROC_BROWSER_TEST_F(HostZoomMapIframeSigninBrowserTest, |
EventsForNonDefaultStoragePartition) { |
ZoomLevelChangeObserver observer(browser()->profile()); |
// TODO(wjmaclean): Make this test more general by implementing a way to |
@@ -255,17 +290,16 @@ IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest, |
content::WebContents* web_contents = |
browser()->tab_strip_model()->GetActiveWebContents(); |
- // Verify that our loaded page is using a HostZoomMap different from the |
- // one for the default StoragePartition. |
+ // We are forcing non-webview based signin, so we expect the signin page to |
+ // be in a different storage partition, and hence a different HostZoomMap. |
HostZoomMap* host_zoom_map = HostZoomMap::GetForWebContents(web_contents); |
// For the webview based sign-in code, the sign in page uses the default host |
Charlie Reis
2015/03/11 20:23:10
Please update this comment.
wjmaclean
2015/03/23 15:31:52
Done.
|
// zoom map. |
- if (!switches::IsEnableWebviewBasedSignin()) { |
- HostZoomMap* default_profile_host_zoom_map = |
- HostZoomMap::GetDefaultForBrowserContext(browser()->profile()); |
- EXPECT_NE(host_zoom_map, default_profile_host_zoom_map); |
- } |
+ EXPECT_FALSE(switches::IsEnableWebviewBasedSignin()); |
+ HostZoomMap* default_profile_host_zoom_map = |
+ HostZoomMap::GetDefaultForBrowserContext(browser()->profile()); |
+ EXPECT_NE(host_zoom_map, default_profile_host_zoom_map); |
double new_zoom_level = |
host_zoom_map->GetZoomLevelForHostAndScheme(test_scheme, test_host) + 0.5; |