| OLD | NEW |
| 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 5229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5240 TEST_F(WebFrameTest, CreateChildFrameFailure) | 5240 TEST_F(WebFrameTest, CreateChildFrameFailure) |
| 5241 { | 5241 { |
| 5242 registerMockedHttpURLLoad("create_child_frame_fail.html"); | 5242 registerMockedHttpURLLoad("create_child_frame_fail.html"); |
| 5243 FailCreateChildFrame client; | 5243 FailCreateChildFrame client; |
| 5244 FrameTestHelpers::WebViewHelper webViewHelper; | 5244 FrameTestHelpers::WebViewHelper webViewHelper; |
| 5245 webViewHelper.initializeAndLoad(m_baseURL + "create_child_frame_fail.html",
true, &client); | 5245 webViewHelper.initializeAndLoad(m_baseURL + "create_child_frame_fail.html",
true, &client); |
| 5246 | 5246 |
| 5247 EXPECT_EQ(1, client.callCount()); | 5247 EXPECT_EQ(1, client.callCount()); |
| 5248 } | 5248 } |
| 5249 | 5249 |
| 5250 TEST_F(WebFrameTest, sizeChangeRepaint) |
| 5251 { |
| 5252 const char* kTests[] = { |
| 5253 "repaint/size-change-repaint1.html", |
| 5254 "repaint/size-change-repaint2.html", |
| 5255 "repaint/size-change-repaint3.html", |
| 5256 "repaint/size-change-repaint4.html", |
| 5257 "repaint/size-change-repaint5.html", |
| 5258 "repaint/size-change-repaint6.html", |
| 5259 "repaint/size-change-repaint7.html", |
| 5260 "repaint/size-change-repaint8.html", |
| 5261 "repaint/size-change-repaint9.html", |
| 5262 "repaint/size-change-repaint10.html", |
| 5263 }; |
| 5264 |
| 5265 const WebCore::IntRect kExpectedRepaintOnHeightChange[] = { |
| 5266 WebCore::IntRect(0, 200, 200, 100), |
| 5267 WebCore::IntRect(0, 200, 200, 100), |
| 5268 WebCore::IntRect(0, 200, 200, 100), |
| 5269 WebCore::IntRect(0, 0, 200, 300), |
| 5270 WebCore::IntRect(0, 0, 200, 300), |
| 5271 WebCore::IntRect(0, 0, 200, 300), |
| 5272 WebCore::IntRect(0, 100, 200, 200), |
| 5273 WebCore::IntRect(0, 100, 200, 200), |
| 5274 WebCore::IntRect(0, 160, 200, 140), |
| 5275 WebCore::IntRect(0, 50, 200, 250), |
| 5276 }; |
| 5277 |
| 5278 const WebCore::IntRect kExpectedRepaintOnWidthChange[] = { |
| 5279 WebCore::IntRect(0, 0, 300, 300), |
| 5280 WebCore::IntRect(0, 0, 300, 300), |
| 5281 WebCore::IntRect(0, 0, 300, 300), |
| 5282 WebCore::IntRect(0, 0, 300, 300), |
| 5283 WebCore::IntRect(0, 0, 300, 300), |
| 5284 WebCore::IntRect(0, 0, 300, 300), |
| 5285 WebCore::IntRect(0, 0, 300, 300), |
| 5286 WebCore::IntRect(0, 0, 300, 300), |
| 5287 WebCore::IntRect(0, 0, 300, 300), |
| 5288 WebCore::IntRect(0, 0, 300, 300), |
| 5289 }; |
| 5290 |
| 5291 UseMockScrollbarSettings mockScrollbarSettings; |
| 5292 |
| 5293 FrameTestHelpers::WebViewHelper webViewHelper; |
| 5294 WebViewImpl* webView = webViewHelper.initialize(true); |
| 5295 |
| 5296 for (size_t i = 0; i < arraysize(kTests); ++i) { |
| 5297 SCOPED_TRACE(kTests[i]); |
| 5298 registerMockedHttpURLLoad(kTests[i]); |
| 5299 FrameTestHelpers::loadFrame(webView->mainFrame(), m_baseURL + kTests[i])
; |
| 5300 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests(
); |
| 5301 |
| 5302 webView->resize(WebSize(200, 200)); |
| 5303 webView->layout(); |
| 5304 |
| 5305 // Change height. |
| 5306 WebCore::FrameView* frameView = webView->mainFrameImpl()->frameView(); |
| 5307 frameView->setTracksRepaints(true); |
| 5308 webView->resize(WebSize(200, 300)); |
| 5309 webView->layout(); |
| 5310 WebCore::IntRect repaintRect = WebCore::intersection(WebCore::IntRect(0,
0, 200, 300), WebCore::unionRect(frameView->trackedRepaintRects())); |
| 5311 EXPECT_EQ_RECT(kExpectedRepaintOnHeightChange[i], repaintRect); |
| 5312 |
| 5313 // Change width. |
| 5314 frameView->setTracksRepaints(true); |
| 5315 webView->resize(WebSize(300, 300)); |
| 5316 webView->layout(); |
| 5317 repaintRect = WebCore::intersection(WebCore::IntRect(0, 0, 300, 300), We
bCore::unionRect(frameView->trackedRepaintRects())); |
| 5318 EXPECT_EQ_RECT(kExpectedRepaintOnWidthChange[i], repaintRect); |
| 5319 frameView->setTracksRepaints(false); |
| 5320 } |
| 5321 } |
| 5322 |
| 5250 TEST_F(WebFrameTest, fixedPositionInFixedViewport) | 5323 TEST_F(WebFrameTest, fixedPositionInFixedViewport) |
| 5251 { | 5324 { |
| 5252 UseMockScrollbarSettings mockScrollbarSettings; | 5325 UseMockScrollbarSettings mockScrollbarSettings; |
| 5253 registerMockedHttpURLLoad("fixed-position-in-fixed-viewport.html"); | 5326 registerMockedHttpURLLoad("fixed-position-in-fixed-viewport.html"); |
| 5254 FrameTestHelpers::WebViewHelper webViewHelper; | 5327 FrameTestHelpers::WebViewHelper webViewHelper; |
| 5255 webViewHelper.initializeAndLoad(m_baseURL + "fixed-position-in-fixed-viewpor
t.html", true, 0, 0, enableViewportSettings); | 5328 webViewHelper.initializeAndLoad(m_baseURL + "fixed-position-in-fixed-viewpor
t.html", true, 0, 0, enableViewportSettings); |
| 5256 | 5329 |
| 5257 WebView* webView = webViewHelper.webView(); | 5330 WebView* webView = webViewHelper.webView(); |
| 5258 webView->resize(WebSize(100, 100)); | 5331 webView->resize(WebSize(100, 100)); |
| 5259 webView->layout(); | 5332 webView->layout(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5291 webViewHelper.initializeAndLoad("about:blank"); | 5364 webViewHelper.initializeAndLoad("about:blank"); |
| 5292 | 5365 |
| 5293 WebCore::FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()
->frameView(); | 5366 WebCore::FrameView* frameView = webViewHelper.webViewImpl()->mainFrameImpl()
->frameView(); |
| 5294 frameView->setFrameRect(WebCore::IntRect(0, 0, 200, 200)); | 5367 frameView->setFrameRect(WebCore::IntRect(0, 0, 200, 200)); |
| 5295 EXPECT_EQ_RECT(WebCore::IntRect(0, 0, 200, 200), frameView->frameRect()); | 5368 EXPECT_EQ_RECT(WebCore::IntRect(0, 0, 200, 200), frameView->frameRect()); |
| 5296 frameView->setFrameRect(WebCore::IntRect(100, 100, 200, 200)); | 5369 frameView->setFrameRect(WebCore::IntRect(100, 100, 200, 200)); |
| 5297 EXPECT_EQ_RECT(WebCore::IntRect(100, 100, 200, 200), frameView->frameRect())
; | 5370 EXPECT_EQ_RECT(WebCore::IntRect(100, 100, 200, 200), frameView->frameRect())
; |
| 5298 } | 5371 } |
| 5299 | 5372 |
| 5300 } // namespace | 5373 } // namespace |
| OLD | NEW |