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

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

Issue 952273006: Make the constructor of a LayoutRect from an IntRect explicit. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/WebPluginContainerImpl.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) 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 SkBitmap bitmap; 345 SkBitmap bitmap;
346 bitmap.allocN32Pixels(kWidth, kHeight); 346 bitmap.allocN32Pixels(kWidth, kHeight);
347 SkCanvas canvas(bitmap); 347 SkCanvas canvas(bitmap);
348 canvas.clear(kAlphaRed); 348 canvas.clear(kAlphaRed);
349 349
350 GraphicsContext context(&canvas, nullptr); 350 GraphicsContext context(&canvas, nullptr);
351 351
352 // Paint the root of the main frame in the way that CompositedLayerMapping w ould. 352 // Paint the root of the main frame in the way that CompositedLayerMapping w ould.
353 FrameView* view = m_webViewHelper.webViewImpl()->mainFrameImpl()->frameView( ); 353 FrameView* view = m_webViewHelper.webViewImpl()->mainFrameImpl()->frameView( );
354 Layer* rootLayer = view->layoutView()->layer(); 354 Layer* rootLayer = view->layoutView()->layer();
355 IntRect paintRect(0, 0, kWidth, kHeight); 355 LayoutRect paintRect(0, 0, kWidth, kHeight);
356 LayerPaintingInfo paintingInfo(rootLayer, paintRect, PaintBehaviorNormal, La youtSize()); 356 LayerPaintingInfo paintingInfo(rootLayer, paintRect, PaintBehaviorNormal, La youtSize());
357 LayerPainter(*rootLayer).paintLayerContents(&context, paintingInfo, PaintLay erPaintingCompositingAllPhases); 357 LayerPainter(*rootLayer).paintLayerContents(&context, paintingInfo, PaintLay erPaintingCompositingAllPhases);
358 358
359 // The result should be a blend of red and green. 359 // The result should be a blend of red and green.
360 SkColor color = bitmap.getColor(kWidth / 2, kHeight / 2); 360 SkColor color = bitmap.getColor(kWidth / 2, kHeight / 2);
361 EXPECT_TRUE(redChannel(color)); 361 EXPECT_TRUE(redChannel(color));
362 EXPECT_TRUE(greenChannel(color)); 362 EXPECT_TRUE(greenChannel(color));
363 } 363 }
364 364
365 TEST_F(WebViewTest, FocusIsInactive) 365 TEST_F(WebViewTest, FocusIsInactive)
(...skipping 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after
2389 // Test without any preventDefault. 2389 // Test without any preventDefault.
2390 client.reset(); 2390 client.reset();
2391 frame->executeScript(WebScriptSource("setTest('none');")); 2391 frame->executeScript(WebScriptSource("setTest('none');"));
2392 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target"))); 2392 EXPECT_TRUE(tapElementById(webView, WebInputEvent::GestureTap, WebString::fr omUTF8("target")));
2393 EXPECT_TRUE(client.getWasCalled()); 2393 EXPECT_TRUE(client.getWasCalled());
2394 2394
2395 m_webViewHelper.reset(); // Remove dependency on locally scoped client. 2395 m_webViewHelper.reset(); // Remove dependency on locally scoped client.
2396 } 2396 }
2397 2397
2398 } // namespace 2398 } // namespace
OLDNEW
« no previous file with comments | « Source/web/WebPluginContainerImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698