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

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

Issue 2860673002: Change all test cases to use WebViewBase instead of WebViewImpl. (Closed)
Patch Set: Address code review comments. Created 3 years, 7 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
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 30 matching lines...) Expand all
41 #include "platform/graphics/GraphicsContext.h" 41 #include "platform/graphics/GraphicsContext.h"
42 #include "platform/graphics/paint/CullRect.h" 42 #include "platform/graphics/paint/CullRect.h"
43 #include "platform/graphics/paint/ForeignLayerDisplayItem.h" 43 #include "platform/graphics/paint/ForeignLayerDisplayItem.h"
44 #include "platform/graphics/paint/PaintController.h" 44 #include "platform/graphics/paint/PaintController.h"
45 #include "platform/graphics/paint/PaintRecorder.h" 45 #include "platform/graphics/paint/PaintRecorder.h"
46 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" 46 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h"
47 #include "platform/testing/URLTestHelpers.h" 47 #include "platform/testing/URLTestHelpers.h"
48 #include "platform/testing/UnitTestHelpers.h" 48 #include "platform/testing/UnitTestHelpers.h"
49 #include "public/platform/Platform.h" 49 #include "public/platform/Platform.h"
50 #include "public/platform/WebClipboard.h" 50 #include "public/platform/WebClipboard.h"
51 #include "public/platform/WebCoalescedInputEvent.h"
51 #include "public/platform/WebCompositorSupport.h" 52 #include "public/platform/WebCompositorSupport.h"
52 #include "public/platform/WebLayer.h" 53 #include "public/platform/WebLayer.h"
53 #include "public/platform/WebMouseWheelEvent.h" 54 #include "public/platform/WebMouseWheelEvent.h"
54 #include "public/platform/WebThread.h" 55 #include "public/platform/WebThread.h"
55 #include "public/platform/WebTouchEvent.h" 56 #include "public/platform/WebTouchEvent.h"
56 #include "public/platform/WebURLLoaderMockFactory.h" 57 #include "public/platform/WebURLLoaderMockFactory.h"
57 #include "public/web/WebDocument.h" 58 #include "public/web/WebDocument.h"
58 #include "public/web/WebElement.h" 59 #include "public/web/WebElement.h"
59 #include "public/web/WebFrame.h" 60 #include "public/web/WebFrame.h"
60 #include "public/web/WebFrameClient.h" 61 #include "public/web/WebFrameClient.h"
(...skipping 990 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 static_cast<const ForeignLayerDisplayItem&>(display_items[0]); 1052 static_cast<const ForeignLayerDisplayItem&>(display_items[0]);
1052 EXPECT_EQ(plugin->GetWebLayer()->CcLayer(), 1053 EXPECT_EQ(plugin->GetWebLayer()->CcLayer(),
1053 foreign_layer_display_item.GetLayer()); 1054 foreign_layer_display_item.GetLayer());
1054 } 1055 }
1055 1056
1056 TEST_F(WebPluginContainerTest, NeedsWheelEvents) { 1057 TEST_F(WebPluginContainerTest, NeedsWheelEvents) {
1057 RegisterMockedURL("plugin_container.html"); 1058 RegisterMockedURL("plugin_container.html");
1058 TestPluginWebFrameClient 1059 TestPluginWebFrameClient
1059 plugin_web_frame_client; // Must outlive webViewHelper 1060 plugin_web_frame_client; // Must outlive webViewHelper
1060 FrameTestHelpers::WebViewHelper web_view_helper; 1061 FrameTestHelpers::WebViewHelper web_view_helper;
1061 WebViewImpl* web_view = web_view_helper.InitializeAndLoad( 1062 WebViewBase* web_view = web_view_helper.InitializeAndLoad(
1062 base_url_ + "plugin_container.html", true, &plugin_web_frame_client); 1063 base_url_ + "plugin_container.html", true, &plugin_web_frame_client);
1063 DCHECK(web_view); 1064 DCHECK(web_view);
1064 web_view->GetSettings()->SetPluginsEnabled(true); 1065 web_view->GetSettings()->SetPluginsEnabled(true);
1065 web_view->Resize(WebSize(300, 300)); 1066 web_view->Resize(WebSize(300, 300));
1066 web_view->UpdateAllLifecyclePhases(); 1067 web_view->UpdateAllLifecyclePhases();
1067 RunPendingTasks(); 1068 RunPendingTasks();
1068 1069
1069 WebElement plugin_container_one_element = 1070 WebElement plugin_container_one_element =
1070 web_view->MainFrame()->GetDocument().GetElementById( 1071 web_view->MainFrame()->GetDocument().GetElementById(
1071 WebString::FromUTF8("translated-plugin")); 1072 WebString::FromUTF8("translated-plugin"));
1072 plugin_container_one_element.PluginContainer()->SetWantsWheelEvents(true); 1073 plugin_container_one_element.PluginContainer()->SetWantsWheelEvents(true);
1073 1074
1074 RunPendingTasks(); 1075 RunPendingTasks();
1075 EXPECT_TRUE(web_view->GetPage()->GetEventHandlerRegistry().HasEventHandlers( 1076 EXPECT_TRUE(web_view->GetPage()->GetEventHandlerRegistry().HasEventHandlers(
1076 EventHandlerRegistry::kWheelEventBlocking)); 1077 EventHandlerRegistry::kWheelEventBlocking));
1077 } 1078 }
1078 1079
1079 } // namespace blink 1080 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698