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

Unified Diff: Source/WebKit/chromium/tests/LinkHighlightTest.cpp

Issue 14921004: Revert "Clear highlight when the highlighted node gets removed from the document" (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebKit/chromium/src/LinkHighlight.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/tests/LinkHighlightTest.cpp
diff --git a/Source/WebKit/chromium/tests/LinkHighlightTest.cpp b/Source/WebKit/chromium/tests/LinkHighlightTest.cpp
index 533f7d98de93004caac2e69ea172b858d59537c5..c2f3d3927299ac3a473e8a4ac546998eca2b782e 100644
--- a/Source/WebKit/chromium/tests/LinkHighlightTest.cpp
+++ b/Source/WebKit/chromium/tests/LinkHighlightTest.cpp
@@ -31,11 +31,9 @@
#include "URLTestHelpers.h"
#include "WebCompositorInitializer.h"
#include "WebFrame.h"
-#include "WebFrameClient.h"
#include "WebFrameImpl.h"
#include "WebInputEvent.h"
#include "WebInputEventConversion.h"
-#include "WebViewClient.h"
#include "WebViewImpl.h"
#include "core/dom/Node.h"
#include "core/page/FrameView.h"
@@ -43,10 +41,8 @@
#include <public/WebContentLayer.h>
#include <public/WebFloatPoint.h>
#include <public/WebSize.h>
-#include <public/WebUnitTestSupport.h>
#include <wtf/PassOwnPtr.h>
-
using namespace WebKit;
using namespace WebCore;
@@ -125,75 +121,4 @@ TEST(LinkHighlightTest, verifyWebViewImplIntegration)
webViewImpl->close();
}
-class FakeWebFrameClient : public WebFrameClient {
- // To make the destructor public.
-};
-
-class FakeCompositingWebViewClient : public WebViewClient {
-public:
- virtual ~FakeCompositingWebViewClient()
- {
- }
-
- virtual void initializeLayerTreeView() OVERRIDE
- {
- m_layerTreeView = adoptPtr(Platform::current()->unitTestSupport()->createLayerTreeViewForTesting(WebUnitTestSupport::TestViewTypeUnitTest));
- ASSERT(m_layerTreeView);
- }
-
- virtual WebLayerTreeView* layerTreeView() OVERRIDE
- {
- return m_layerTreeView.get();
- }
-
- FakeWebFrameClient m_fakeWebFrameClient;
-
-private:
- OwnPtr<WebLayerTreeView> m_layerTreeView;
-};
-
-static WebViewClient* compositingWebViewClient()
-{
- DEFINE_STATIC_LOCAL(FakeCompositingWebViewClient, client, ());
- return &client;
-}
-
-TEST(LinkHighlightTest, resetDuringNodeRemoval)
-{
- WebKitTests::WebCompositorInitializer compositorInitializer(0);
-
- const std::string baseURL("http://www.test.com/");
- const std::string fileName("test_touch_link_highlight.html");
-
- URLTestHelpers::registerMockedURLFromBaseURL(WebString::fromUTF8(baseURL.c_str()), WebString::fromUTF8("test_touch_link_highlight.html"));
- WebViewImpl* webViewImpl = static_cast<WebViewImpl*>(FrameTestHelpers::createWebViewAndLoad(baseURL + fileName, true, 0, compositingWebViewClient()));
-
- int pageWidth = 640;
- int pageHeight = 480;
- webViewImpl->resize(WebSize(pageWidth, pageHeight));
- webViewImpl->layout();
-
- WebGestureEvent touchEvent;
- touchEvent.type = WebInputEvent::GestureTapDown;
- touchEvent.x = 20;
- touchEvent.y = 20;
-
- PlatformGestureEventBuilder platformEvent(webViewImpl->mainFrameImpl()->frameView(), touchEvent);
- Node* touchNode = webViewImpl->bestTapNode(platformEvent);
- ASSERT_TRUE(touchNode);
-
- webViewImpl->enableTapHighlight(platformEvent);
- ASSERT_TRUE(webViewImpl->linkHighlight());
-
- GraphicsLayerChromium* highlightLayer = webViewImpl->linkHighlight()->currentGraphicsLayerForTesting();
- ASSERT_TRUE(highlightLayer);
- EXPECT_TRUE(highlightLayer->linkHighlight());
-
- touchNode->remove(IGNORE_EXCEPTION);
- webViewImpl->layout();
- EXPECT_FALSE(highlightLayer->linkHighlight());
-
- webViewImpl->close();
-}
-
} // namespace
« no previous file with comments | « Source/WebKit/chromium/src/LinkHighlight.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698