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

Unified Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html

Issue 197923006: Refactor touch hit-testing hover/active tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use states instead of colors Created 6 years, 9 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: LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html
diff --git a/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html b/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html
index db501df4a48417b22d2793096ccb9ae71c7120bd..7a1212676a794c5561dd8df33a488dc4b5553abf 100644
--- a/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html
+++ b/LayoutTests/fast/events/touch/gesture/gesture-tap-active-state-iframe.html
@@ -8,7 +8,6 @@
left: 400px;
height: 3000px;
}
-
</style>
<body>
<iframe src='resources/gesture-tap-active-state-iframe-inner.html' id='frame'>
@@ -19,15 +18,14 @@
<div id="console"></div>
+<script src="../resources/touch-hover-active-tests.js"></script>
<script>
+var box;
description("Tests that tap gesture events set and clear the active state of elements, even when inside an iframe and the document is scrolled.");
-var isBoxActive;
-function runTests(ba)
+function runTests()
{
- isBoxActive = ba;
-
if (!window.eventSender) {
debug('This test requires DRT.');
return;
@@ -38,15 +36,18 @@ function runTests(ba)
return;
}
+ box = document.getElementById("frame").contentDocument.getElementById('box');
+
// Scroll so the box is at the top
window.scrollTo(0, 400);
debug("Verify active isn't initially set");
- shouldBeFalse("isBoxActive()");
+ shouldBeDefault("getHoverActiveState(box)");
- debug("Verify tapdown,tap sets and clears active");
+ debug("Verify showPress, tap sets and clears active");
+ eventSender.gestureTapDown(450, 50);
eventSender.gestureShowPress(450, 50);
- shouldBeTrue("isBoxActive()");
+ shouldBeHoveredAndActive("getHoverActiveState(box)");
eventSender.gestureTap(450, 50);
// FIXME: Enable after implementing mocked timers (http://crbug.com/319529)
// shouldBeTrue("isBoxActive()");
@@ -55,11 +56,11 @@ function runTests(ba)
function waitUntilActiveCleared()
{
- if(isBoxActive()) {
+ if(getHoverActiveState(box) == "hoveredAndActive") {
return setTimeout(waitUntilActiveCleared, 10);
}
- shouldBeFalse("isBoxActive()");
+ shouldBeOnlyHovered("getHoverActiveState(box)");
finishJSTest();
}
@@ -68,6 +69,7 @@ if (window.testRunner) {
testRunner.waitUntilDone();
}
+window.onload = runTests;
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698