OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/site_per_process_browsertest.h" | 5 #include "content/browser/site_per_process_browsertest.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
736 return result; | 736 return result; |
737 } | 737 } |
738 }; | 738 }; |
739 | 739 |
740 bool operator==(const ParsedFeaturePolicyDeclaration& first, | 740 bool operator==(const ParsedFeaturePolicyDeclaration& first, |
741 const ParsedFeaturePolicyDeclaration& second) { | 741 const ParsedFeaturePolicyDeclaration& second) { |
742 return std::tie(first.feature, first.matches_all_origins, first.origins) == | 742 return std::tie(first.feature, first.matches_all_origins, first.origins) == |
743 std::tie(second.feature, second.matches_all_origins, second.origins); | 743 std::tie(second.feature, second.matches_all_origins, second.origins); |
744 } | 744 } |
745 | 745 |
746 double GetFrameDeviceScaleFactor(const ToRenderFrameHost& adapter) { | |
iclelland
2017/03/15 17:14:54
Do you know why this showed up in this CL? It look
| |
747 double device_scale_factor; | |
748 const char kGetFrameDeviceScaleFactor[] = | |
749 "window.domAutomationController.send(window.devicePixelRatio);"; | |
750 EXPECT_TRUE(ExecuteScriptAndExtractDouble(adapter, kGetFrameDeviceScaleFactor, | |
751 &device_scale_factor)); | |
752 return device_scale_factor; | |
753 } | |
754 | |
746 IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIBrowserTest, | 755 IN_PROC_BROWSER_TEST_F(SitePerProcessHighDPIBrowserTest, |
747 SubframeLoadsWithCorrectDeviceScaleFactor) { | 756 SubframeLoadsWithCorrectDeviceScaleFactor) { |
748 GURL main_url(embedded_test_server()->GetURL( | 757 GURL main_url(embedded_test_server()->GetURL( |
749 "a.com", "/cross_site_iframe_factory.html?a(b)")); | 758 "a.com", "/cross_site_iframe_factory.html?a(b)")); |
750 EXPECT_TRUE(NavigateToURL(shell(), main_url)); | 759 EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
751 | 760 |
752 // On Android forcing device scale factor does not work for tests, therefore | 761 // On Android forcing device scale factor does not work for tests, therefore |
753 // we ensure that make frame and iframe have the same DIP scale there, but | 762 // we ensure that make frame and iframe have the same DIP scale there, but |
754 // not necessarily kDeviceScaleFactor. | 763 // not necessarily kDeviceScaleFactor. |
755 const double expected_dip_scale = | 764 const double expected_dip_scale = |
(...skipping 9041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9797 | 9806 |
9798 // Try the same navigation, but use the browser-initiated path. | 9807 // Try the same navigation, but use the browser-initiated path. |
9799 NavigateFrameToURL(root->child_at(0), frame_url); | 9808 NavigateFrameToURL(root->child_at(0), frame_url); |
9800 EXPECT_FALSE(root->child_at(0)->render_manager()->pending_frame_host()); | 9809 EXPECT_FALSE(root->child_at(0)->render_manager()->pending_frame_host()); |
9801 EXPECT_EQ(root->child_at(0)->current_url(), redirected_url); | 9810 EXPECT_EQ(root->child_at(0)->current_url(), redirected_url); |
9802 EXPECT_EQ(b_site_instance, | 9811 EXPECT_EQ(b_site_instance, |
9803 root->child_at(0)->current_frame_host()->GetSiteInstance()); | 9812 root->child_at(0)->current_frame_host()->GetSiteInstance()); |
9804 } | 9813 } |
9805 | 9814 |
9806 } // namespace content | 9815 } // namespace content |
OLD | NEW |