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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 GURL test_url1 = ConstructTestServerURL(kTestURLTemplate1); | 282 GURL test_url1 = ConstructTestServerURL(kTestURLTemplate1); |
283 ui_test_utils::NavigateToURL(browser(), test_url1); | 283 ui_test_utils::NavigateToURL(browser(), test_url1); |
284 | 284 |
285 SetDefaultZoomLevel(default_zoom_level); | 285 SetDefaultZoomLevel(default_zoom_level); |
286 observer.BlockUntilZoomLevelForHostHasChanged(test_url1.host()); | 286 observer.BlockUntilZoomLevelForHostHasChanged(test_url1.host()); |
287 EXPECT_TRUE( | 287 EXPECT_TRUE( |
288 content::ZoomValuesEqual(default_zoom_level, GetZoomLevel(test_url1))); | 288 content::ZoomValuesEqual(default_zoom_level, GetZoomLevel(test_url1))); |
289 | 289 |
290 GURL test_url2 = ConstructTestServerURL(kTestURLTemplate2); | 290 GURL test_url2 = ConstructTestServerURL(kTestURLTemplate2); |
291 ui_test_utils::NavigateToURLWithDisposition( | 291 ui_test_utils::NavigateToURLWithDisposition( |
292 browser(), test_url2, NEW_FOREGROUND_TAB, | 292 browser(), test_url2, WindowOpenDisposition::NEW_FOREGROUND_TAB, |
293 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 293 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
294 EXPECT_TRUE( | 294 EXPECT_TRUE( |
295 content::ZoomValuesEqual(default_zoom_level, GetZoomLevel(test_url2))); | 295 content::ZoomValuesEqual(default_zoom_level, GetZoomLevel(test_url2))); |
296 | 296 |
297 content::WebContents* web_contents = | 297 content::WebContents* web_contents = |
298 browser()->tab_strip_model()->GetActiveWebContents(); | 298 browser()->tab_strip_model()->GetActiveWebContents(); |
299 zoom::PageZoom::Zoom(web_contents, content::PAGE_ZOOM_OUT); | 299 zoom::PageZoom::Zoom(web_contents, content::PAGE_ZOOM_OUT); |
300 observer.BlockUntilZoomLevelForHostHasChanged(test_url2.host()); | 300 observer.BlockUntilZoomLevelForHostHasChanged(test_url2.host()); |
301 EXPECT_FALSE( | 301 EXPECT_FALSE( |
302 content::ZoomValuesEqual(default_zoom_level, GetZoomLevel(test_url2))); | 302 content::ZoomValuesEqual(default_zoom_level, GetZoomLevel(test_url2))); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 ZoomLevelChangeObserver observer(browser()->profile()); | 409 ZoomLevelChangeObserver observer(browser()->profile()); |
410 | 410 |
411 web_contents->SetPageScale(1.5); | 411 web_contents->SetPageScale(1.5); |
412 observer.BlockUntilZoomLevelForHostHasChanged(test_host); | 412 observer.BlockUntilZoomLevelForHostHasChanged(test_host); |
413 EXPECT_FALSE(content::HostZoomMap::PageScaleFactorIsOne(web_contents)); | 413 EXPECT_FALSE(content::HostZoomMap::PageScaleFactorIsOne(web_contents)); |
414 | 414 |
415 web_contents->SetPageScale(1.f); | 415 web_contents->SetPageScale(1.f); |
416 observer.BlockUntilZoomLevelForHostHasChanged(test_host); | 416 observer.BlockUntilZoomLevelForHostHasChanged(test_host); |
417 EXPECT_TRUE(content::HostZoomMap::PageScaleFactorIsOne(web_contents)); | 417 EXPECT_TRUE(content::HostZoomMap::PageScaleFactorIsOne(web_contents)); |
418 } | 418 } |
OLD | NEW |