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

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

Issue 1845323002: Remove WebUnitTestSupport (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/testing/URLTestHelpers.h" 45 #include "platform/testing/URLTestHelpers.h"
46 #include "platform/testing/UnitTestHelpers.h" 46 #include "platform/testing/UnitTestHelpers.h"
47 #include "public/platform/Platform.h" 47 #include "public/platform/Platform.h"
48 #include "public/platform/WebClipboard.h" 48 #include "public/platform/WebClipboard.h"
49 #include "public/platform/WebCompositorSupport.h" 49 #include "public/platform/WebCompositorSupport.h"
50 #include "public/platform/WebLayer.h" 50 #include "public/platform/WebLayer.h"
51 #include "public/platform/WebThread.h" 51 #include "public/platform/WebThread.h"
52 #include "public/platform/WebUnitTestSupport.h" 52 #include "public/platform/WebURLLoaderMockFactory.h"
53 #include "public/web/WebCache.h"
53 #include "public/web/WebDocument.h" 54 #include "public/web/WebDocument.h"
54 #include "public/web/WebElement.h" 55 #include "public/web/WebElement.h"
55 #include "public/web/WebFrame.h" 56 #include "public/web/WebFrame.h"
56 #include "public/web/WebFrameClient.h" 57 #include "public/web/WebFrameClient.h"
57 #include "public/web/WebPluginParams.h" 58 #include "public/web/WebPluginParams.h"
58 #include "public/web/WebPrintParams.h" 59 #include "public/web/WebPrintParams.h"
59 #include "public/web/WebSettings.h" 60 #include "public/web/WebSettings.h"
60 #include "public/web/WebView.h" 61 #include "public/web/WebView.h"
61 #include "testing/gtest/include/gtest/gtest.h" 62 #include "testing/gtest/include/gtest/gtest.h"
62 #include "third_party/skia/include/core/SkPictureRecorder.h" 63 #include "third_party/skia/include/core/SkPictureRecorder.h"
63 #include "web/WebLocalFrameImpl.h" 64 #include "web/WebLocalFrameImpl.h"
64 #include "web/WebPluginContainerImpl.h" 65 #include "web/WebPluginContainerImpl.h"
65 #include "web/WebViewImpl.h" 66 #include "web/WebViewImpl.h"
66 #include "web/tests/FakeWebPlugin.h" 67 #include "web/tests/FakeWebPlugin.h"
67 #include "web/tests/FrameTestHelpers.h" 68 #include "web/tests/FrameTestHelpers.h"
68 69
69 using blink::testing::runPendingTasks; 70 using blink::testing::runPendingTasks;
70 71
71 namespace blink { 72 namespace blink {
72 73
73 class WebPluginContainerTest : public ::testing::Test { 74 class WebPluginContainerTest : public ::testing::Test {
74 public: 75 public:
75 WebPluginContainerTest() 76 WebPluginContainerTest()
76 : m_baseURL("http://www.test.com/") 77 : m_baseURL("http://www.test.com/")
77 { 78 {
78 } 79 }
79 80
80 void TearDown() override 81 void TearDown() override
81 { 82 {
82 Platform::current()->unitTestSupport()->unregisterAllMockedURLs(); 83 Platform::current()->getURLLoaderMockFactory()->unregisterAllURLs();
84 WebCache::clear();
83 } 85 }
84 86
85 void calculateGeometry(WebPluginContainerImpl* pluginContainerImpl, IntRect& windowRect, IntRect& clipRect, IntRect& unobscuredRect, Vector<IntRect>& cutOut Rects) 87 void calculateGeometry(WebPluginContainerImpl* pluginContainerImpl, IntRect& windowRect, IntRect& clipRect, IntRect& unobscuredRect, Vector<IntRect>& cutOut Rects)
86 { 88 {
87 pluginContainerImpl->calculateGeometry(windowRect, clipRect, unobscuredR ect, cutOutRects); 89 pluginContainerImpl->calculateGeometry(windowRect, clipRect, unobscuredR ect, cutOutRects);
88 } 90 }
89 91
90 protected: 92 protected:
91 std::string m_baseURL; 93 std::string m_baseURL;
92 }; 94 };
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after
648 runPendingTasks(); 650 runPendingTasks();
649 651
650 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE lementById(WebString::fromUTF8("translated-plugin")); 652 WebElement pluginContainerOneElement = webView->mainFrame()->document().getE lementById(WebString::fromUTF8("translated-plugin"));
651 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true); 653 pluginContainerOneElement.pluginContainer()->setWantsWheelEvents(true);
652 654
653 runPendingTasks(); 655 runPendingTasks();
654 EXPECT_TRUE(webView->page()->frameHost().eventHandlerRegistry().hasEventHand lers(EventHandlerRegistry::WheelEventBlocking)); 656 EXPECT_TRUE(webView->page()->frameHost().eventHandlerRegistry().hasEventHand lers(EventHandlerRegistry::WheelEventBlocking));
655 } 657 }
656 658
657 } // namespace blink 659 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698