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

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

Issue 2573883002: Refactor PaintChunkProperties to use PropertyTreeState (Closed)
Patch Set: none 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
« no previous file with comments | « third_party/WebKit/Source/platform/testing/TestPaintArtifact.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) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
727 runPendingTasks(); 727 runPendingTasks();
728 728
729 WebPluginContainerImpl* container = static_cast<WebPluginContainerImpl*>( 729 WebPluginContainerImpl* container = static_cast<WebPluginContainerImpl*>(
730 getWebPluginContainer(webView, WebString::fromUTF8("plugin"))); 730 getWebPluginContainer(webView, WebString::fromUTF8("plugin")));
731 ASSERT_TRUE(container); 731 ASSERT_TRUE(container);
732 Element* element = static_cast<Element*>(container->element()); 732 Element* element = static_cast<Element*>(container->element());
733 const auto* plugin = 733 const auto* plugin =
734 static_cast<const CompositedPlugin*>(container->plugin()); 734 static_cast<const CompositedPlugin*>(container->plugin());
735 735
736 std::unique_ptr<PaintController> paintController = PaintController::create(); 736 std::unique_ptr<PaintController> paintController = PaintController::create();
737 PaintChunkProperties properties; 737 PropertyTreeState propertyTreeState(
738 properties.transform = TransformPaintPropertyNode::root(); 738 TransformPaintPropertyNode::root(), ClipPaintPropertyNode::root(),
739 properties.clip = ClipPaintPropertyNode::root(); 739 EffectPaintPropertyNode::root(), ScrollPaintPropertyNode::root());
740 properties.effect = EffectPaintPropertyNode::root(); 740 PaintChunkProperties properties(propertyTreeState);
741 properties.scroll = ScrollPaintPropertyNode::root(); 741
742 paintController->updateCurrentPaintChunkProperties(nullptr, properties); 742 paintController->updateCurrentPaintChunkProperties(nullptr, properties);
743 GraphicsContext graphicsContext(*paintController); 743 GraphicsContext graphicsContext(*paintController);
744 container->paint(graphicsContext, CullRect(IntRect(10, 10, 400, 300))); 744 container->paint(graphicsContext, CullRect(IntRect(10, 10, 400, 300)));
745 paintController->commitNewDisplayItems(); 745 paintController->commitNewDisplayItems();
746 746
747 const auto& displayItems = 747 const auto& displayItems =
748 paintController->paintArtifact().getDisplayItemList(); 748 paintController->paintArtifact().getDisplayItemList();
749 ASSERT_EQ(1u, displayItems.size()); 749 ASSERT_EQ(1u, displayItems.size());
750 EXPECT_EQ(element->layoutObject(), &displayItems[0].client()); 750 EXPECT_EQ(element->layoutObject(), &displayItems[0].client());
751 ASSERT_EQ(DisplayItem::kForeignLayerPlugin, displayItems[0].getType()); 751 ASSERT_EQ(DisplayItem::kForeignLayerPlugin, displayItems[0].getType());
(...skipping 21 matching lines...) Expand all
773 WebString::fromUTF8("translated-plugin")); 773 WebString::fromUTF8("translated-plugin"));
774 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); 774 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true);
775 775
776 runPendingTasks(); 776 runPendingTasks();
777 EXPECT_TRUE( 777 EXPECT_TRUE(
778 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers( 778 webView->page()->frameHost().eventHandlerRegistry().hasEventHandlers(
779 EventHandlerRegistry::WheelEventBlocking)); 779 EventHandlerRegistry::WheelEventBlocking));
780 } 780 }
781 781
782 } // namespace blink 782 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/testing/TestPaintArtifact.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698