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

Unified Diff: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp

Issue 2127163002: Limit PassiveDocumentEventListeners to touch and make it experimental (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A few more layout tests Created 4 years, 5 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
Index: third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
index 667b09874c808cb497a15fa91243c7cb09cf6313..ece0e76276c90ae945aeaa84266377611880d183 100644
--- a/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
+++ b/third_party/WebKit/Source/web/tests/FrameThrottlingTest.cpp
@@ -631,11 +631,7 @@ TEST_F(FrameThrottlingTest, ThrottledTopLevelEventHandlerIgnored)
loadURL("https://example.com/");
mainResource.complete("<iframe id=frame sandbox=allow-scripts src=iframe.html></iframe>");
- frameResource.complete(
- "<script>"
- "window.addEventListener('touchstart', function(){});"
- "document.addEventListener('touchstart', function(){});"
- "</script>");
+ frameResource.complete("<body style='touch-action: none'></body>");
Rick Byers 2016/07/07 20:02:09 Is using touch-action really better than explicit
dtapuska 2016/07/07 20:34:22 I was trying to future proof it if we move the pas
Rick Byers 2016/07/07 20:45:01 Ah, I see. I think we'll have to think harder abo
auto* frameElement = toHTMLIFrameElement(document().getElementById("frame"));
frameElement->setAttribute(styleAttr, "transform: translateY(480px)");
compositeFrame(); // Throttle the frame.
@@ -644,9 +640,7 @@ TEST_F(FrameThrottlingTest, ThrottledTopLevelEventHandlerIgnored)
// The touch handlers in the throttled frame should have been ignored.
EXPECT_EQ(0u, touchHandlerRegionSize());
- // Unthrottling the frame makes the touch handlers active again. Note that
- // both handlers get combined into the same rectangle in the region, so
- // there is only one rectangle in total.
+ // Unthrottling the frame makes the touch handlers active again.
frameElement->setAttribute(styleAttr, "transform: translateY(0px)");
compositeFrame(); // Unthrottle the frame.
compositeFrame(); // Update touch handler regions.

Powered by Google App Engine
This is Rietveld 408576698