| OLD | NEW |
| 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 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 const auto* plugin = static_cast<const CompositedPlugin*>(container->plugin(
)); | 656 const auto* plugin = static_cast<const CompositedPlugin*>(container->plugin(
)); |
| 657 | 657 |
| 658 std::unique_ptr<PaintController> paintController = PaintController::create()
; | 658 std::unique_ptr<PaintController> paintController = PaintController::create()
; |
| 659 GraphicsContext graphicsContext(*paintController); | 659 GraphicsContext graphicsContext(*paintController); |
| 660 container->paint(graphicsContext, CullRect(IntRect(10, 10, 400, 300))); | 660 container->paint(graphicsContext, CullRect(IntRect(10, 10, 400, 300))); |
| 661 paintController->commitNewDisplayItems(); | 661 paintController->commitNewDisplayItems(); |
| 662 | 662 |
| 663 const auto& displayItems = paintController->paintArtifact().getDisplayItemLi
st(); | 663 const auto& displayItems = paintController->paintArtifact().getDisplayItemLi
st(); |
| 664 ASSERT_EQ(1u, displayItems.size()); | 664 ASSERT_EQ(1u, displayItems.size()); |
| 665 EXPECT_EQ(element->layoutObject(), &displayItems[0].client()); | 665 EXPECT_EQ(element->layoutObject(), &displayItems[0].client()); |
| 666 ASSERT_EQ(DisplayItem::ForeignLayerPlugin, displayItems[0].getType()); | 666 ASSERT_EQ(DisplayItem::kForeignLayerPlugin, displayItems[0].getType()); |
| 667 const auto& foreignLayerDisplayItem = static_cast<const ForeignLayerDisplayI
tem&>(displayItems[0]); | 667 const auto& foreignLayerDisplayItem = static_cast<const ForeignLayerDisplayI
tem&>(displayItems[0]); |
| 668 EXPECT_EQ(plugin->getWebLayer()->ccLayer(), foreignLayerDisplayItem.layer())
; | 668 EXPECT_EQ(plugin->getWebLayer()->ccLayer(), foreignLayerDisplayItem.layer())
; |
| 669 } | 669 } |
| 670 | 670 |
| 671 TEST_F(WebPluginContainerTest, NeedsWheelEvents) | 671 TEST_F(WebPluginContainerTest, NeedsWheelEvents) |
| 672 { | 672 { |
| 673 URLTestHelpers::registerMockedURLFromBaseURL( | 673 URLTestHelpers::registerMockedURLFromBaseURL( |
| 674 WebString::fromUTF8(m_baseURL.c_str()), | 674 WebString::fromUTF8(m_baseURL.c_str()), |
| 675 WebString::fromUTF8("plugin_container.html")); | 675 WebString::fromUTF8("plugin_container.html")); |
| 676 TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper | 676 TestPluginWebFrameClient pluginWebFrameClient; // Must outlive webViewHelper |
| 677 FrameTestHelpers::WebViewHelper webViewHelper; | 677 FrameTestHelpers::WebViewHelper webViewHelper; |
| 678 WebViewImpl* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_c
ontainer.html", true, &pluginWebFrameClient); | 678 WebViewImpl* webView = webViewHelper.initializeAndLoad(m_baseURL + "plugin_c
ontainer.html", true, &pluginWebFrameClient); |
| 679 DCHECK(webView); | 679 DCHECK(webView); |
| 680 webView->settings()->setPluginsEnabled(true); | 680 webView->settings()->setPluginsEnabled(true); |
| 681 webView->resize(WebSize(300, 300)); | 681 webView->resize(WebSize(300, 300)); |
| 682 webView->updateAllLifecyclePhases(); | 682 webView->updateAllLifecyclePhases(); |
| 683 runPendingTasks(); | 683 runPendingTasks(); |
| 684 | 684 |
| 685 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE
lementById(WebString::fromUTF8("translated-plugin")); | 685 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE
lementById(WebString::fromUTF8("translated-plugin")); |
| 686 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); | 686 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); |
| 687 | 687 |
| 688 runPendingTasks(); | 688 runPendingTasks(); |
| 689 EXPECT_TRUE(webView->page()->frameHost().eventHandlerRegistry().hasEventHand
lers(EventHandlerRegistry::WheelEventBlocking)); | 689 EXPECT_TRUE(webView->page()->frameHost().eventHandlerRegistry().hasEventHand
lers(EventHandlerRegistry::WheelEventBlocking)); |
| 690 } | 690 } |
| 691 | 691 |
| 692 } // namespace blink | 692 } // namespace blink |
| OLD | NEW |