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

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

Issue 235323005: Revert of Optimize repaint on FrameView resize (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 8 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
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 5270 matching lines...) Expand 10 before | Expand all | Expand 10 after
5281 TEST_F(WebFrameTest, CreateChildFrameFailure) 5281 TEST_F(WebFrameTest, CreateChildFrameFailure)
5282 { 5282 {
5283 registerMockedHttpURLLoad("create_child_frame_fail.html"); 5283 registerMockedHttpURLLoad("create_child_frame_fail.html");
5284 FailCreateChildFrame client; 5284 FailCreateChildFrame client;
5285 FrameTestHelpers::WebViewHelper webViewHelper; 5285 FrameTestHelpers::WebViewHelper webViewHelper;
5286 webViewHelper.initializeAndLoad(m_baseURL + "create_child_frame_fail.html", true, &client); 5286 webViewHelper.initializeAndLoad(m_baseURL + "create_child_frame_fail.html", true, &client);
5287 5287
5288 EXPECT_EQ(1, client.callCount()); 5288 EXPECT_EQ(1, client.callCount());
5289 } 5289 }
5290 5290
5291 TEST_F(WebFrameTest, DISABLED_sizeChangeRepaint)
5292 {
5293 const char* kTests[] = {
5294 "repaint/size-change-repaint1.html",
5295 "repaint/size-change-repaint2.html",
5296 "repaint/size-change-repaint3.html",
5297 "repaint/size-change-repaint4.html",
5298 "repaint/size-change-repaint5.html",
5299 "repaint/size-change-repaint6.html",
5300 "repaint/size-change-repaint7.html",
5301 "repaint/size-change-repaint8.html",
5302 "repaint/size-change-repaint9.html",
5303 "repaint/size-change-repaint10.html",
5304 };
5305
5306 const WebCore::IntRect kExpectedRepaintOnHeightChange[] = {
5307 WebCore::IntRect(0, 200, 200, 100),
5308 WebCore::IntRect(0, 200, 200, 100),
5309 WebCore::IntRect(0, 200, 200, 100),
5310 WebCore::IntRect(0, 0, 200, 300),
5311 WebCore::IntRect(0, 0, 200, 300),
5312 WebCore::IntRect(0, 0, 200, 300),
5313 WebCore::IntRect(0, 100, 200, 200),
5314 WebCore::IntRect(0, 100, 200, 200),
5315 WebCore::IntRect(0, 160, 200, 140),
5316 WebCore::IntRect(0, 50, 200, 250),
5317 };
5318
5319 const WebCore::IntRect kExpectedRepaintOnWidthChange[] = {
5320 WebCore::IntRect(0, 0, 300, 300),
5321 WebCore::IntRect(0, 0, 300, 300),
5322 WebCore::IntRect(0, 0, 300, 300),
5323 WebCore::IntRect(0, 0, 300, 300),
5324 WebCore::IntRect(0, 0, 300, 300),
5325 WebCore::IntRect(0, 0, 300, 300),
5326 WebCore::IntRect(0, 0, 300, 300),
5327 WebCore::IntRect(0, 0, 300, 300),
5328 WebCore::IntRect(0, 0, 300, 300),
5329 WebCore::IntRect(0, 0, 300, 300),
5330 };
5331
5332 UseMockScrollbarSettings mockScrollbarSettings;
5333
5334 FrameTestHelpers::WebViewHelper webViewHelper;
5335 WebViewImpl* webView = webViewHelper.initialize(true);
5336
5337 for (size_t i = 0; i < arraysize(kTests); ++i) {
5338 SCOPED_TRACE(kTests[i]);
5339 registerMockedHttpURLLoad(kTests[i]);
5340 FrameTestHelpers::loadFrame(webView->mainFrame(), m_baseURL + kTests[i]) ;
5341 Platform::current()->unitTestSupport()->serveAsynchronousMockedRequests( );
5342
5343 webView->resize(WebSize(200, 200));
5344 webView->layout();
5345
5346 // Change height.
5347 WebCore::FrameView* frameView = webView->mainFrameImpl()->frameView();
5348 frameView->setTracksRepaints(true);
5349 webView->resize(WebSize(200, 300));
5350 webView->layout();
5351 WebCore::IntRect repaintRect = WebCore::intersection(WebCore::IntRect(0, 0, 200, 300), WebCore::unionRect(frameView->trackedRepaintRects()));
5352 EXPECT_EQ_RECT(kExpectedRepaintOnHeightChange[i], repaintRect);
5353
5354 // Change width.
5355 frameView->setTracksRepaints(true);
5356 webView->resize(WebSize(300, 300));
5357 webView->layout();
5358 repaintRect = WebCore::intersection(WebCore::IntRect(0, 0, 300, 300), We bCore::unionRect(frameView->trackedRepaintRects()));
5359 EXPECT_EQ_RECT(kExpectedRepaintOnWidthChange[i], repaintRect);
5360 frameView->setTracksRepaints(false);
5361 }
5362 }
5363
5364 TEST_F(WebFrameTest, fixedPositionInFixedViewport) 5291 TEST_F(WebFrameTest, fixedPositionInFixedViewport)
5365 { 5292 {
5366 UseMockScrollbarSettings mockScrollbarSettings; 5293 UseMockScrollbarSettings mockScrollbarSettings;
5367 registerMockedHttpURLLoad("fixed-position-in-fixed-viewport.html"); 5294 registerMockedHttpURLLoad("fixed-position-in-fixed-viewport.html");
5368 FrameTestHelpers::WebViewHelper webViewHelper; 5295 FrameTestHelpers::WebViewHelper webViewHelper;
5369 webViewHelper.initializeAndLoad(m_baseURL + "fixed-position-in-fixed-viewpor t.html", true, 0, 0, enableViewportSettings); 5296 webViewHelper.initializeAndLoad(m_baseURL + "fixed-position-in-fixed-viewpor t.html", true, 0, 0, enableViewportSettings);
5370 5297
5371 WebView* webView = webViewHelper.webView(); 5298 WebView* webView = webViewHelper.webView();
5372 webView->resize(WebSize(100, 100)); 5299 webView->resize(WebSize(100, 100));
5373 webView->layout(); 5300 webView->layout();
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
5467 EXPECT_EQ(2U, container->percentHeightDescendants()->size()); 5394 EXPECT_EQ(2U, container->percentHeightDescendants()->size());
5468 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous)); 5395 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightInA nonymous));
5469 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild)); 5396 EXPECT_TRUE(container->percentHeightDescendants()->contains(percentHeightDir ectChild));
5470 5397
5471 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock(); 5398 WebCore::RenderBlock* anonymousBlock = percentHeightInAnonymous->containingB lock();
5472 EXPECT_TRUE(anonymousBlock->isAnonymous()); 5399 EXPECT_TRUE(anonymousBlock->isAnonymous());
5473 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants()); 5400 EXPECT_FALSE(anonymousBlock->hasPercentHeightDescendants());
5474 } 5401 }
5475 5402
5476 } // namespace 5403 } // namespace
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderObject.h ('k') | Source/web/tests/data/repaint/size-change-repaint1.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698