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 "core/frame/VisualViewport.h" | 5 #include "core/frame/VisualViewport.h" |
6 | 6 |
7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
8 #include "core/frame/BrowserControls.h" | 8 #include "core/frame/BrowserControls.h" |
9 #include "core/frame/FrameView.h" | 9 #include "core/frame/FrameView.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
783 EXPECT_EQ(2, visualViewport.Scale()); | 783 EXPECT_EQ(2, visualViewport.Scale()); |
784 | 784 |
785 // Navigate again, this time the FrameView should be smaller. | 785 // Navigate again, this time the FrameView should be smaller. |
786 registerMockedHttpURLLoad("viewport-device-width.html"); | 786 registerMockedHttpURLLoad("viewport-device-width.html"); |
787 navigateTo(m_baseURL + "viewport-device-width.html"); | 787 navigateTo(m_baseURL + "viewport-device-width.html"); |
788 | 788 |
789 // Ensure the scroll layer matches the frame view's size. | 789 // Ensure the scroll layer matches the frame view's size. |
790 EXPECT_SIZE_EQ(FloatSize(320, 240), visualViewport.ScrollLayer()->Size()); | 790 EXPECT_SIZE_EQ(FloatSize(320, 240), visualViewport.ScrollLayer()->Size()); |
791 | 791 |
792 EXPECT_EQ(static_cast<int>(CompositorSubElementId::kViewport), | 792 EXPECT_EQ(static_cast<int>(CompositorSubElementId::kViewport), |
793 visualViewport.ScrollLayer()->GetElementId().secondaryId); | 793 visualViewport.ScrollLayer()->GetElementId() % 4); |
suzyh_UTC10 (ex-contributor)
2017/05/05 04:27:31
Please explain this piece of magic with variable/m
chrishtr
2017/05/05 05:34:52
Done.
| |
794 | 794 |
795 // Ensure the location and scale were reset. | 795 // Ensure the location and scale were reset. |
796 EXPECT_SIZE_EQ(FloatSize(), visualViewport.GetScrollOffset()); | 796 EXPECT_SIZE_EQ(FloatSize(), visualViewport.GetScrollOffset()); |
797 EXPECT_EQ(1, visualViewport.Scale()); | 797 EXPECT_EQ(1, visualViewport.Scale()); |
798 } | 798 } |
799 | 799 |
800 // The main FrameView's size should be set such that its the size of the visual | 800 // The main FrameView's size should be set such that its the size of the visual |
801 // viewport at minimum scale. Test that the FrameView is appropriately sized in | 801 // viewport at minimum scale. Test that the FrameView is appropriately sized in |
802 // the presence of a viewport <meta> tag. | 802 // the presence of a viewport <meta> tag. |
803 TEST_P(VisualViewportTest, TestFrameViewSizedToViewportMetaMinimumScale) { | 803 TEST_P(VisualViewportTest, TestFrameViewSizedToViewportMetaMinimumScale) { |
(...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2448 " body {" | 2448 " body {" |
2449 " margin: 0px;" | 2449 " margin: 0px;" |
2450 " }" | 2450 " }" |
2451 " div { height:110vh; width: 110vw; }" | 2451 " div { height:110vh; width: 110vw; }" |
2452 "</style>" | 2452 "</style>" |
2453 "<div></div>", | 2453 "<div></div>", |
2454 baseURL); | 2454 baseURL); |
2455 } | 2455 } |
2456 | 2456 |
2457 } // namespace | 2457 } // namespace |
OLD | NEW |