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

Side by Side Diff: Source/web/tests/WebFrameTest.cpp

Issue 1209293004: WIP - improve ScrollableArea handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 5 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/web/tests/ScrollAnimatorNoneTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 switch (config) { 285 switch (config) {
286 case Default: 286 case Default:
287 *os << "Default"; 287 *os << "Default";
288 break; 288 break;
289 case RootLayerScrolls: 289 case RootLayerScrolls:
290 *os << "RootLayerScrolls"; 290 *os << "RootLayerScrolls";
291 break; 291 break;
292 } 292 }
293 } 293 }
294 294
295 #if OS(MACOSX) && ENABLE(OILPAN)
296 // FIXME(504655): RootLayerScrolls configuration crashes on Mac Oilpan bots.
297 INSTANTIATE_TEST_CASE_P(All, ParameterizedWebFrameTest, ::testing::Values(
298 ParameterizedWebFrameTestConfig::Default));
299 #else
300 INSTANTIATE_TEST_CASE_P(All, ParameterizedWebFrameTest, ::testing::Values( 295 INSTANTIATE_TEST_CASE_P(All, ParameterizedWebFrameTest, ::testing::Values(
301 ParameterizedWebFrameTestConfig::Default, 296 ParameterizedWebFrameTestConfig::Default,
302 ParameterizedWebFrameTestConfig::RootLayerScrolls)); 297 ParameterizedWebFrameTestConfig::RootLayerScrolls));
303 #endif
304 298
305 TEST_P(ParameterizedWebFrameTest, ContentText) 299 TEST_P(ParameterizedWebFrameTest, ContentText)
306 { 300 {
307 registerMockedHttpURLLoad("iframes_test.html"); 301 registerMockedHttpURLLoad("iframes_test.html");
308 registerMockedHttpURLLoad("visible_iframe.html"); 302 registerMockedHttpURLLoad("visible_iframe.html");
309 registerMockedHttpURLLoad("invisible_iframe.html"); 303 registerMockedHttpURLLoad("invisible_iframe.html");
310 registerMockedHttpURLLoad("zero_sized_iframe.html"); 304 registerMockedHttpURLLoad("zero_sized_iframe.html");
311 305
312 FrameTestHelpers::WebViewHelper webViewHelper(this); 306 FrameTestHelpers::WebViewHelper webViewHelper(this);
313 webViewHelper.initializeAndLoad(m_baseURL + "iframes_test.html"); 307 webViewHelper.initializeAndLoad(m_baseURL + "iframes_test.html");
(...skipping 1902 matching lines...) Expand 10 before | Expand all | Expand 10 after
2216 webViewHelper.webViewImpl()->resize(WebSize(viewportSize.width, view portSize.height * 0.8f)); 2210 webViewHelper.webViewImpl()->resize(WebSize(viewportSize.width, view portSize.height * 0.8f));
2217 EXPECT_EQ(initialPageScaleFactor, webViewHelper.webViewImpl()->pageS caleFactor()); 2211 EXPECT_EQ(initialPageScaleFactor, webViewHelper.webViewImpl()->pageS caleFactor());
2218 EXPECT_EQ(expectedScrollOffset, webViewHelper.webViewImpl()->mainFra me()->scrollOffset()); 2212 EXPECT_EQ(expectedScrollOffset, webViewHelper.webViewImpl()->mainFra me()->scrollOffset());
2219 webViewHelper.webViewImpl()->resize(WebSize(viewportSize.width, view portSize.height * 0.8f)); 2213 webViewHelper.webViewImpl()->resize(WebSize(viewportSize.width, view portSize.height * 0.8f));
2220 EXPECT_EQ(initialPageScaleFactor, webViewHelper.webViewImpl()->pageS caleFactor()); 2214 EXPECT_EQ(initialPageScaleFactor, webViewHelper.webViewImpl()->pageS caleFactor());
2221 EXPECT_EQ(expectedScrollOffset, webViewHelper.webViewImpl()->mainFra me()->scrollOffset()); 2215 EXPECT_EQ(expectedScrollOffset, webViewHelper.webViewImpl()->mainFra me()->scrollOffset());
2222 } 2216 }
2223 } 2217 }
2224 }; 2218 };
2225 2219
2226 #if OS(MACOSX) && ENABLE(OILPAN)
2227 // FIXME(504655): RootLayerScrolls configuration crashes on Mac Oilpan bots.
2228 INSTANTIATE_TEST_CASE_P(All, WebFrameResizeTest, ::testing::Values(
2229 ParameterizedWebFrameTestConfig::Default));
2230 #else
2231 INSTANTIATE_TEST_CASE_P(All, WebFrameResizeTest, ::testing::Values( 2220 INSTANTIATE_TEST_CASE_P(All, WebFrameResizeTest, ::testing::Values(
2232 ParameterizedWebFrameTestConfig::Default, 2221 ParameterizedWebFrameTestConfig::Default,
2233 ParameterizedWebFrameTestConfig::RootLayerScrolls)); 2222 ParameterizedWebFrameTestConfig::RootLayerScrolls));
2234 #endif
2235 2223
2236 TEST_P(WebFrameResizeTest, ResizeYieldsCorrectScrollAndScaleForWidthEqualsDevice Width) 2224 TEST_P(WebFrameResizeTest, ResizeYieldsCorrectScrollAndScaleForWidthEqualsDevice Width)
2237 { 2225 {
2238 // With width=device-width, pageScaleFactor is preserved across resizes as 2226 // With width=device-width, pageScaleFactor is preserved across resizes as
2239 // long as the content adjusts according to the device-width. 2227 // long as the content adjusts according to the device-width.
2240 const char* url = "resize_scroll_mobile.html"; 2228 const char* url = "resize_scroll_mobile.html";
2241 const float initialPageScaleFactor = 1; 2229 const float initialPageScaleFactor = 1;
2242 const WebSize scrollOffset(0, 50); 2230 const WebSize scrollOffset(0, 50);
2243 const WebSize viewportSize(120, 160); 2231 const WebSize viewportSize(120, 160);
2244 const bool shouldScaleRelativeToViewportWidth = true; 2232 const bool shouldScaleRelativeToViewportWidth = true;
(...skipping 5642 matching lines...) Expand 10 before | Expand all | Expand 10 after
7887 7875
7888 TEST_F(WebFrameTest, MaxFramesDetach) 7876 TEST_F(WebFrameTest, MaxFramesDetach)
7889 { 7877 {
7890 registerMockedHttpURLLoad("max-frames-detach.html"); 7878 registerMockedHttpURLLoad("max-frames-detach.html");
7891 FrameTestHelpers::WebViewHelper webViewHelper; 7879 FrameTestHelpers::WebViewHelper webViewHelper;
7892 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max- frames-detach.html", true); 7880 WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(m_baseURL + "max- frames-detach.html", true);
7893 webViewImpl->mainFrameImpl()->collectGarbage(); 7881 webViewImpl->mainFrameImpl()->collectGarbage();
7894 } 7882 }
7895 7883
7896 } // namespace blink 7884 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/tests/ScrollAnimatorNoneTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698