| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/files/file_path.h" | 6 #include "base/files/file_path.h" |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 93 |
| 94 double GetFrameDeviceScaleFactor(const content::ToRenderFrameHost& adapter) { | 94 double GetFrameDeviceScaleFactor(const content::ToRenderFrameHost& adapter) { |
| 95 double device_scale_factor; | 95 double device_scale_factor; |
| 96 const char kGetFrameDeviceScaleFactor[] = | 96 const char kGetFrameDeviceScaleFactor[] = |
| 97 "window.domAutomationController.send(window.devicePixelRatio);"; | 97 "window.domAutomationController.send(window.devicePixelRatio);"; |
| 98 EXPECT_TRUE(ExecuteScriptAndExtractDouble(adapter, kGetFrameDeviceScaleFactor, | 98 EXPECT_TRUE(ExecuteScriptAndExtractDouble(adapter, kGetFrameDeviceScaleFactor, |
| 99 &device_scale_factor)); | 99 &device_scale_factor)); |
| 100 return device_scale_factor; | 100 return device_scale_factor; |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Flaky on Windows 10. http://crbug.com/700150 |
| 104 #if defined(OS_WIN) |
| 105 #define MAYBE_InterstitialLoadsWithCorrectDeviceScaleFactor \ |
| 106 DISABLED_InterstitialLoadsWithCorrectDeviceScaleFactor |
| 107 #else |
| 108 #define MAYBE_InterstitialLoadsWithCorrectDeviceScaleFactor \ |
| 109 InterstitialLoadsWithCorrectDeviceScaleFactor |
| 110 #endif |
| 103 IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIExpiredCertBrowserTest, | 111 IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIExpiredCertBrowserTest, |
| 104 InterstitialLoadsWithCorrectDeviceScaleFactor) { | 112 MAYBE_InterstitialLoadsWithCorrectDeviceScaleFactor) { |
| 105 GURL main_url(embedded_test_server()->GetURL( | 113 GURL main_url(embedded_test_server()->GetURL( |
| 106 "a.com", "/cross_site_iframe_factory.html?a(b)")); | 114 "a.com", "/cross_site_iframe_factory.html?a(b)")); |
| 107 ui_test_utils::NavigateToURL(browser(), main_url); | 115 ui_test_utils::NavigateToURL(browser(), main_url); |
| 108 | 116 |
| 109 EXPECT_EQ(SitePerProcessHighDPIExpiredCertBrowserTest::kDeviceScaleFactor, | 117 EXPECT_EQ(SitePerProcessHighDPIExpiredCertBrowserTest::kDeviceScaleFactor, |
| 110 GetFrameDeviceScaleFactor( | 118 GetFrameDeviceScaleFactor( |
| 111 browser()->tab_strip_model()->GetActiveWebContents())); | 119 browser()->tab_strip_model()->GetActiveWebContents())); |
| 112 | 120 |
| 113 // Navigate to page with expired cert. | 121 // Navigate to page with expired cert. |
| 114 GURL bad_cert_url( | 122 GURL bad_cert_url( |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 "document.querySelector('iframe').src = '" + frame_url.spec() + "';\n" | 501 "document.querySelector('iframe').src = '" + frame_url.spec() + "';\n" |
| 494 "var w = window.open('about:blank');\n" | 502 "var w = window.open('about:blank');\n" |
| 495 "window.domAutomationController.send(!!w);\n", | 503 "window.domAutomationController.send(!!w);\n", |
| 496 &popup_handle_is_valid)); | 504 &popup_handle_is_valid)); |
| 497 popup_observer.Wait(); | 505 popup_observer.Wait(); |
| 498 | 506 |
| 499 // The popup shouldn't be blocked. | 507 // The popup shouldn't be blocked. |
| 500 EXPECT_TRUE(popup_handle_is_valid); | 508 EXPECT_TRUE(popup_handle_is_valid); |
| 501 ASSERT_EQ(2, browser()->tab_strip_model()->count()); | 509 ASSERT_EQ(2, browser()->tab_strip_model()->count()); |
| 502 } | 510 } |
| OLD | NEW |