OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/public/browser/host_zoom_map.h" | 5 #include "content/public/browser/host_zoom_map.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 private: | 214 private: |
215 DISALLOW_COPY_AND_ASSIGN(HostZoomMapSanitizationBrowserTest); | 215 DISALLOW_COPY_AND_ASSIGN(HostZoomMapSanitizationBrowserTest); |
216 }; | 216 }; |
217 | 217 |
218 // Regression test for crbug.com/437392 | 218 // Regression test for crbug.com/437392 |
219 IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest, ZoomEventsWorkForOffTheRecord) { | 219 IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest, ZoomEventsWorkForOffTheRecord) { |
220 GURL test_url(url::kAboutBlankURL); | 220 GURL test_url(url::kAboutBlankURL); |
221 std::string test_host(test_url.host()); | 221 std::string test_host(test_url.host()); |
222 std::string test_scheme(test_url.scheme()); | 222 std::string test_scheme(test_url.scheme()); |
223 Browser* incognito_browser = | 223 Browser* incognito_browser = |
224 ui_test_utils::OpenURLOffTheRecord(browser()->profile(), test_url); | 224 OpenURLOffTheRecord(browser()->profile(), test_url); |
225 | 225 |
226 content::WebContents* web_contents = | 226 content::WebContents* web_contents = |
227 incognito_browser->tab_strip_model()->GetActiveWebContents(); | 227 incognito_browser->tab_strip_model()->GetActiveWebContents(); |
228 | 228 |
229 content::BrowserContext* context = web_contents->GetBrowserContext(); | 229 content::BrowserContext* context = web_contents->GetBrowserContext(); |
230 EXPECT_TRUE(context->IsOffTheRecord()); | 230 EXPECT_TRUE(context->IsOffTheRecord()); |
231 ZoomLevelChangeObserver observer(context); | 231 ZoomLevelChangeObserver observer(context); |
232 HostZoomMap* host_zoom_map = HostZoomMap::GetForWebContents(web_contents); | 232 HostZoomMap* host_zoom_map = HostZoomMap::GetForWebContents(web_contents); |
233 | 233 |
234 double new_zoom_level = | 234 double new_zoom_level = |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 HostZoomMap::GetDefaultForBrowserContext(child_profile); | 511 HostZoomMap::GetDefaultForBrowserContext(child_profile); |
512 ASSERT_TRUE(parent_host_zoom_map); | 512 ASSERT_TRUE(parent_host_zoom_map); |
513 ASSERT_TRUE(child_host_zoom_map); | 513 ASSERT_TRUE(child_host_zoom_map); |
514 EXPECT_NE(parent_host_zoom_map, child_host_zoom_map); | 514 EXPECT_NE(parent_host_zoom_map, child_host_zoom_map); |
515 EXPECT_NE(new_default_zoom_level, child_host_zoom_map->GetDefaultZoomLevel()); | 515 EXPECT_NE(new_default_zoom_level, child_host_zoom_map->GetDefaultZoomLevel()); |
516 | 516 |
517 parent_profile->GetZoomLevelPrefs()->SetDefaultZoomLevelPref( | 517 parent_profile->GetZoomLevelPrefs()->SetDefaultZoomLevelPref( |
518 new_default_zoom_level); | 518 new_default_zoom_level); |
519 EXPECT_EQ(new_default_zoom_level, child_host_zoom_map->GetDefaultZoomLevel()); | 519 EXPECT_EQ(new_default_zoom_level, child_host_zoom_map->GetDefaultZoomLevel()); |
520 } | 520 } |
OLD | NEW |