Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Side by Side Diff: third_party/WebKit/Source/web/tests/RootScrollerTest.cpp

Issue 2917343004: Move LoadHTMLString method from WebFrame to WebLocalFrame. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "bindings/core/v8/NodeOrString.h" 5 #include "bindings/core/v8/NodeOrString.h"
6 #include "core/dom/ClientRect.h" 6 #include "core/dom/ClientRect.h"
7 #include "core/frame/BrowserControls.h" 7 #include "core/frame/BrowserControls.h"
8 #include "core/frame/LocalFrameView.h" 8 #include "core/frame/LocalFrameView.h"
9 #include "core/frame/RootFrameViewport.h" 9 #include "core/frame/RootFrameViewport.h"
10 #include "core/frame/VisualViewport.h" 10 #include "core/frame/VisualViewport.h"
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 EXPECT_FALSE(container_scroller->HorizontalScrollbar()); 838 EXPECT_FALSE(container_scroller->HorizontalScrollbar());
839 EXPECT_FALSE(container_scroller->VerticalScrollbar()); 839 EXPECT_FALSE(container_scroller->VerticalScrollbar());
840 EXPECT_GT(container_scroller->MaximumScrollOffset().Width(), 0); 840 EXPECT_GT(container_scroller->MaximumScrollOffset().Width(), 0);
841 EXPECT_GT(container_scroller->MaximumScrollOffset().Height(), 0); 841 EXPECT_GT(container_scroller->MaximumScrollOffset().Height(), 0);
842 } 842 }
843 843
844 TEST_F(RootScrollerTest, TopControlsAdjustmentAppliedToRootScroller) { 844 TEST_F(RootScrollerTest, TopControlsAdjustmentAppliedToRootScroller) {
845 Initialize(); 845 Initialize();
846 846
847 WebURL base_url = URLTestHelpers::ToKURL("http://www.test.com/"); 847 WebURL base_url = URLTestHelpers::ToKURL("http://www.test.com/");
848 FrameTestHelpers::LoadHTMLString(GetWebView()->MainFrame(), 848 FrameTestHelpers::LoadHTMLString(GetWebView()->MainFrameImpl(),
849 "<!DOCTYPE html>" 849 "<!DOCTYPE html>"
850 "<style>" 850 "<style>"
851 " body, html {" 851 " body, html {"
852 " width: 100%;" 852 " width: 100%;"
853 " height: 100%;" 853 " height: 100%;"
854 " margin: 0px;" 854 " margin: 0px;"
855 " }" 855 " }"
856 " #container {" 856 " #container {"
857 " width: 100%;" 857 " width: 100%;"
858 " height: 100%;" 858 " height: 100%;"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 1115
1116 // Test that hit testing in the area revealed at the bottom of the screen 1116 // Test that hit testing in the area revealed at the bottom of the screen
1117 // revealed by hiding the URL bar works properly when using a root scroller 1117 // revealed by hiding the URL bar works properly when using a root scroller
1118 // when the target and scroller are in the same PaintLayer. 1118 // when the target and scroller are in the same PaintLayer.
1119 TEST_F(RootScrollerHitTest, HitTestInAreaRevealedByURLBarSameLayer) { 1119 TEST_F(RootScrollerHitTest, HitTestInAreaRevealedByURLBarSameLayer) {
1120 // Add a target at the bottom of the root scroller that's the size of the url 1120 // Add a target at the bottom of the root scroller that's the size of the url
1121 // bar. We'll test that hiding the URL bar appropriately adjusts clipping so 1121 // bar. We'll test that hiding the URL bar appropriately adjusts clipping so
1122 // that we can hit this target. 1122 // that we can hit this target.
1123 Initialize(); 1123 Initialize();
1124 WebURL baseURL = URLTestHelpers::ToKURL("http://www.test.com/"); 1124 WebURL baseURL = URLTestHelpers::ToKURL("http://www.test.com/");
1125 FrameTestHelpers::LoadHTMLString(GetWebView()->MainFrame(), 1125 FrameTestHelpers::LoadHTMLString(GetWebView()->MainFrameImpl(),
1126 "<!DOCTYPE html>" 1126 "<!DOCTYPE html>"
1127 "<style>" 1127 "<style>"
1128 " body, html {" 1128 " body, html {"
1129 " height: 100%;" 1129 " height: 100%;"
1130 " margin: 0px;" 1130 " margin: 0px;"
1131 " }" 1131 " }"
1132 " #spacer {" 1132 " #spacer {"
1133 " height: 1000px;" 1133 " height: 1000px;"
1134 " }" 1134 " }"
1135 " #container {" 1135 " #container {"
(...skipping 28 matching lines...) Expand all
1164 1164
1165 // Test that hit testing in the area revealed at the bottom of the screen 1165 // Test that hit testing in the area revealed at the bottom of the screen
1166 // revealed by hiding the URL bar works properly when using a root scroller 1166 // revealed by hiding the URL bar works properly when using a root scroller
1167 // when the target and scroller are in different PaintLayers. 1167 // when the target and scroller are in different PaintLayers.
1168 TEST_F(RootScrollerHitTest, HitTestInAreaRevealedByURLBarDifferentLayer) { 1168 TEST_F(RootScrollerHitTest, HitTestInAreaRevealedByURLBarDifferentLayer) {
1169 // Add a target at the bottom of the root scroller that's the size of the url 1169 // Add a target at the bottom of the root scroller that's the size of the url
1170 // bar. We'll test that hiding the URL bar appropriately adjusts clipping so 1170 // bar. We'll test that hiding the URL bar appropriately adjusts clipping so
1171 // that we can hit this target. 1171 // that we can hit this target.
1172 Initialize(); 1172 Initialize();
1173 WebURL baseURL = URLTestHelpers::ToKURL("http://www.test.com/"); 1173 WebURL baseURL = URLTestHelpers::ToKURL("http://www.test.com/");
1174 FrameTestHelpers::LoadHTMLString(GetWebView()->MainFrame(), 1174 FrameTestHelpers::LoadHTMLString(GetWebView()->MainFrameImpl(),
1175 "<!DOCTYPE html>" 1175 "<!DOCTYPE html>"
1176 "<style>" 1176 "<style>"
1177 " body, html {" 1177 " body, html {"
1178 " height: 100%;" 1178 " height: 100%;"
1179 " margin: 0px;" 1179 " margin: 0px;"
1180 " }" 1180 " }"
1181 " #spacer {" 1181 " #spacer {"
1182 " height: 1000px;" 1182 " height: 1000px;"
1183 " }" 1183 " }"
1184 " #container {" 1184 " #container {"
(...skipping 22 matching lines...) Expand all
1207 // Ensure the target and container weren't put into the same layer. 1207 // Ensure the target and container weren't put into the same layer.
1208 ASSERT_NE(ToLayoutBox(target->GetLayoutObject())->EnclosingLayer(), 1208 ASSERT_NE(ToLayoutBox(target->GetLayoutObject())->EnclosingLayer(),
1209 ToLayoutBox(container->GetLayoutObject())->Layer()); 1209 ToLayoutBox(container->GetLayoutObject())->Layer());
1210 1210
1211 CheckHitTestAtBottomOfScreen(); 1211 CheckHitTestAtBottomOfScreen();
1212 } 1212 }
1213 1213
1214 } // namespace 1214 } // namespace
1215 1215
1216 } // namespace blink 1216 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698