Chromium Code Reviews| 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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 784 EXPECT_SIZE_EQ(FloatSize(50, 60), visualViewport.GetScrollOffset()); | 784 EXPECT_SIZE_EQ(FloatSize(50, 60), visualViewport.GetScrollOffset()); |
| 785 EXPECT_EQ(2, visualViewport.Scale()); | 785 EXPECT_EQ(2, visualViewport.Scale()); |
| 786 | 786 |
| 787 // Navigate again, this time the FrameView should be smaller. | 787 // Navigate again, this time the FrameView should be smaller. |
| 788 registerMockedHttpURLLoad("viewport-device-width.html"); | 788 registerMockedHttpURLLoad("viewport-device-width.html"); |
| 789 navigateTo(m_baseURL + "viewport-device-width.html"); | 789 navigateTo(m_baseURL + "viewport-device-width.html"); |
| 790 | 790 |
| 791 // Ensure the scroll layer matches the frame view's size. | 791 // Ensure the scroll layer matches the frame view's size. |
| 792 EXPECT_SIZE_EQ(FloatSize(320, 240), visualViewport.ScrollLayer()->Size()); | 792 EXPECT_SIZE_EQ(FloatSize(320, 240), visualViewport.ScrollLayer()->Size()); |
| 793 | 793 |
| 794 EXPECT_EQ(static_cast<int>(CompositorSubElementId::kViewport), | 794 EXPECT_EQ(static_cast<uint64_t>(CompositorSubElementId::kViewport), |
|
suzyh_UTC10 (ex-contributor)
2017/05/08 01:04:15
Is this cast necessary?
chrishtr
2017/05/08 16:32:13
Not sure. Compiles locally.. Removed it for now, w
| |
| 795 visualViewport.ScrollLayer()->GetElementId().secondaryId); | 795 SubElementIdFromCompositorElementId( |
| 796 visualViewport.ScrollLayer()->GetElementId())); | |
| 796 | 797 |
| 797 // Ensure the location and scale were reset. | 798 // Ensure the location and scale were reset. |
| 798 EXPECT_SIZE_EQ(FloatSize(), visualViewport.GetScrollOffset()); | 799 EXPECT_SIZE_EQ(FloatSize(), visualViewport.GetScrollOffset()); |
| 799 EXPECT_EQ(1, visualViewport.Scale()); | 800 EXPECT_EQ(1, visualViewport.Scale()); |
| 800 } | 801 } |
| 801 | 802 |
| 802 // The main FrameView's size should be set such that its the size of the visual | 803 // The main FrameView's size should be set such that its the size of the visual |
| 803 // viewport at minimum scale. Test that the FrameView is appropriately sized in | 804 // viewport at minimum scale. Test that the FrameView is appropriately sized in |
| 804 // the presence of a viewport <meta> tag. | 805 // the presence of a viewport <meta> tag. |
| 805 TEST_P(VisualViewportTest, TestFrameViewSizedToViewportMetaMinimumScale) { | 806 TEST_P(VisualViewportTest, TestFrameViewSizedToViewportMetaMinimumScale) { |
| (...skipping 1644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2450 " body {" | 2451 " body {" |
| 2451 " margin: 0px;" | 2452 " margin: 0px;" |
| 2452 " }" | 2453 " }" |
| 2453 " div { height:110vh; width: 110vw; }" | 2454 " div { height:110vh; width: 110vw; }" |
| 2454 "</style>" | 2455 "</style>" |
| 2455 "<div></div>", | 2456 "<div></div>", |
| 2456 baseURL); | 2457 baseURL); |
| 2457 } | 2458 } |
| 2458 | 2459 |
| 2459 } // namespace | 2460 } // namespace |
| OLD | NEW |