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

Unified Diff: third_party/WebKit/Source/web/LinkHighlightImplTest.cpp

Issue 1413373007: CC AnimationHost: Fix LinkHighlights detach scope. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 5 years, 1 month 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
Index: third_party/WebKit/Source/web/LinkHighlightImplTest.cpp
diff --git a/third_party/WebKit/Source/web/LinkHighlightImplTest.cpp b/third_party/WebKit/Source/web/LinkHighlightImplTest.cpp
index b528f71dceb3629c9c7f54e94644db803e767524..912a666201ea0a2a17b070f6acd060529a86b194 100644
--- a/third_party/WebKit/Source/web/LinkHighlightImplTest.cpp
+++ b/third_party/WebKit/Source/web/LinkHighlightImplTest.cpp
@@ -169,6 +169,48 @@ TEST(LinkHighlightImplTest, resetDuringNodeRemoval)
Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
}
+TEST(LinkHighlightImplTest, resetLayerTreeView)
+{
+ OwnPtr<FakeCompositingWebViewClient> webViewClient = adoptPtr(new FakeCompositingWebViewClient());
+ webViewClient->setUseCompositorAnimationTimelines(true);
+
+ 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"));
+ FrameTestHelpers::WebViewHelper webViewHelper;
+ WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(baseURL + fileName, true, 0, webViewClient.get());
+
+ int pageWidth = 640;
+ int pageHeight = 480;
+ webViewImpl->resize(WebSize(pageWidth, pageHeight));
+ webViewImpl->updateAllLifecyclePhases();
+
+ WebGestureEvent touchEvent;
+ touchEvent.type = WebInputEvent::GestureShowPress;
+ touchEvent.sourceDevice = WebGestureDeviceTouchscreen;
+ touchEvent.x = 20;
+ touchEvent.y = 20;
+
+ GestureEventWithHitTestResults targetedEvent = getTargetedEvent(webViewImpl, touchEvent);
+ Node* touchNode = webViewImpl->bestTapNode(targetedEvent);
+ ASSERT_TRUE(touchNode);
+
+ webViewImpl->enableTapHighlightAtPoint(targetedEvent);
+ ASSERT_TRUE(webViewImpl->linkHighlight(0));
+
+ GraphicsLayer* highlightLayer = webViewImpl->linkHighlight(0)->currentGraphicsLayerForTesting();
+ ASSERT_TRUE(highlightLayer);
+ EXPECT_TRUE(highlightLayer->linkHighlight(0));
+
+ // Mimic the logic from RenderWidget::Close:
+ webViewImpl->willCloseLayerTreeView();
+ webViewClient.clear();
+ webViewHelper.reset();
+
+ Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
+}
+
TEST(LinkHighlightImplTest, multipleHighlights)
{
FrameTestHelpers::UseMockScrollbarSettings m_mockScrollbarSettings;

Powered by Google App Engine
This is Rietveld 408576698