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

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

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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 /* 1 /*
2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2011, 2012 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 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // would. 468 // would.
469 FrameView* view = m_webViewHelper.webView()->mainFrameImpl()->frameView(); 469 FrameView* view = m_webViewHelper.webView()->mainFrameImpl()->frameView();
470 PaintLayer* rootLayer = view->layoutViewItem().layer(); 470 PaintLayer* rootLayer = view->layoutViewItem().layer();
471 LayoutRect paintRect(0, 0, kWidth, kHeight); 471 LayoutRect paintRect(0, 0, kWidth, kHeight);
472 PaintLayerPaintingInfo paintingInfo(rootLayer, paintRect, 472 PaintLayerPaintingInfo paintingInfo(rootLayer, paintRect,
473 GlobalPaintNormalPhase, LayoutSize()); 473 GlobalPaintNormalPhase, LayoutSize());
474 PaintLayerPainter(*rootLayer) 474 PaintLayerPainter(*rootLayer)
475 .paintLayerContents(pictureBuilder.context(), paintingInfo, 475 .paintLayerContents(pictureBuilder.context(), paintingInfo,
476 PaintLayerPaintingCompositingAllPhases); 476 PaintLayerPaintingCompositingAllPhases);
477 477
478 pictureBuilder.endRecording()->playback(&canvas); 478 pictureBuilder.endRecording()->playback(CdlCanvas::Make(&canvas).get());
479 479
480 // The result should be a blend of red and green. 480 // The result should be a blend of red and green.
481 SkColor color = bitmap.getColor(kWidth / 2, kHeight / 2); 481 SkColor color = bitmap.getColor(kWidth / 2, kHeight / 2);
482 EXPECT_TRUE(redChannel(color)); 482 EXPECT_TRUE(redChannel(color));
483 EXPECT_TRUE(greenChannel(color)); 483 EXPECT_TRUE(greenChannel(color));
484 } 484 }
485 485
486 TEST_P(WebViewTest, FocusIsInactive) { 486 TEST_P(WebViewTest, FocusIsInactive) {
487 URLTestHelpers::registerMockedURLFromBaseURL( 487 URLTestHelpers::registerMockedURLFromBaseURL(
488 WebString::fromUTF8(m_baseURL.c_str()), "visible_iframe.html"); 488 WebString::fromUTF8(m_baseURL.c_str()), "visible_iframe.html");
(...skipping 3871 matching lines...) Expand 10 before | Expand all | Expand 10 after
4360 .translate(50, 55) 4360 .translate(50, 55)
4361 .scale(1. / 2.f); 4361 .scale(1. / 2.f);
4362 EXPECT_EQ(expectedMatrix, 4362 EXPECT_EQ(expectedMatrix,
4363 webViewImpl->getDeviceEmulationTransformForTesting()); 4363 webViewImpl->getDeviceEmulationTransformForTesting());
4364 // visibleContentRect doesn't change. 4364 // visibleContentRect doesn't change.
4365 EXPECT_EQ(IntRect(50, 55, 50, 75), 4365 EXPECT_EQ(IntRect(50, 55, 50, 75),
4366 *devToolsEmulator->visibleContentRectForPainting()); 4366 *devToolsEmulator->visibleContentRectForPainting());
4367 } 4367 }
4368 4368
4369 } // namespace blink 4369 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp ('k') | third_party/WebKit/Source/web/tests/sim/SimCanvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698