зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1517332 [wpt PR 14694] - Change web platform test with mouse inputs under "pinterevents/", a=testonly
Automatic update from web-platform-tests Change web platform test with mouse inputs under "pinterevents/" Use test_driver Actions class in the web platform tests with mouse inputs in "pinterevents/" to simulate mouse inputs to make the tests pass on wpt serve. Bug: 606367 Change-Id: I2f00c3195fafb8bc600250631106cd9eabe79b90 Reviewed-on: https://chromium-review.googlesource.com/c/1383330 Commit-Queue: Lan Wei <lanwei@chromium.org> Reviewed-by: Navid Zolghadr <nzolghadr@chromium.org> Cr-Commit-Position: refs/heads/master@{#619697} -- wpt-commits: f4c7d842e879b63c1f6d40726e49cb178404f34b wpt-pr: 14694
This commit is contained in:
Родитель
a3a4c6c48e
Коммит
180bf11408
|
@ -8,6 +8,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script type="text/javascript" src="pointerevent_support.js"></script>
|
||||
<script type="text/javascript">
|
||||
var detected_pointertypes = {};
|
||||
|
@ -42,7 +45,7 @@
|
|||
detected_pointertypes[event.pointerType] = true;
|
||||
event_log.push(event.type + '@' + event.target.id);
|
||||
if (event.type == 'lostpointercapture') {
|
||||
setTimeout(function() {
|
||||
step_timeout(function() {
|
||||
test_pointer_event.step(function () {
|
||||
var expected_events = "pointerup, lostpointercapture, pointerout, pointerleave";
|
||||
assert_equals(event_log.join(", "), "pointerout@target, pointerleave@target, pointerover@capture-target, pointerenter@capture-target, gotpointercapture@capture-target, pointerup@capture-target, lostpointercapture@capture-target, pointerout@capture-target, pointerleave@capture-target, pointerover@target, pointerenter@target");
|
||||
|
@ -52,6 +55,13 @@
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target})
|
||||
.pointerDown()
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<style>
|
|
@ -6,6 +6,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="pointerevent_support.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -69,6 +72,16 @@
|
|||
}, "lostpointercapture is dispatched on the document");
|
||||
test_lostpointercapture.done();
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: captureButton})
|
||||
.pointerDown()
|
||||
.pointerMove(2, 0, {origin: captureButton})
|
||||
.pointerMove(5, 0, {origin: captureButton})
|
||||
.pointerMove(8, 0, {origin: captureButton})
|
||||
.pointerMove(10, 0, {origin: captureButton})
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<h1>Pointer Events Capture Test</h1>
|
|
@ -7,6 +7,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="pointerevent_support.js"></script>
|
||||
</head>
|
||||
<body onload="run()">
|
||||
|
@ -123,6 +126,15 @@
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: captureButton})
|
||||
.pointerDown()
|
||||
.pointerMove(2, 0, {origin: captureButton})
|
||||
.pointerMove(5, 0, {origin: captureButton})
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<h1>Pointer Events Capture Test</h1>
|
|
@ -9,6 +9,9 @@
|
|||
<!-- /resources/testharness.js -->
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<!-- Additional helper script for common checks across event types -->
|
||||
<script type="text/javascript" src="pointerevent_support.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
@ -48,6 +51,14 @@
|
|||
assert_equals(event.target.id, "parent0", "Recieved " + event.type + " in parent for " + event.target.id);
|
||||
});
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerMove(-10, -10, {origin: target0})
|
||||
.pointerMove(-20, -20, {origin: target0})
|
||||
.pointerMove(0, 0)
|
||||
.send();
|
||||
}
|
||||
|
||||
</script>
|
|
@ -6,6 +6,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="pointerevent_support.js"></script>
|
||||
</head>
|
||||
<body onload="run()">
|
||||
|
@ -49,6 +52,14 @@
|
|||
eventTested = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerMove(0, 0, {origin: target1})
|
||||
.pointerDown()
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<h1>Pointer Events pointerleave tests</h1>
|
|
@ -6,6 +6,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="pointerevent_support.js"></script>
|
||||
</head>
|
||||
<body onload="run()">
|
||||
|
@ -26,6 +29,7 @@
|
|||
|
||||
function run() {
|
||||
var target0 = document.getElementById("target0");
|
||||
var target1 = document.querySelector("#target0 > div");
|
||||
var test_pointerleave = async_test("pointerleave event received");
|
||||
|
||||
on_event(target0, "pointerover", function(event) {
|
||||
|
@ -40,6 +44,13 @@
|
|||
eventTested = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerMove(0, 0, {origin: target1})
|
||||
.pointerMove(0, 0)
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<h1>Pointer Events pointerleave tests</h1>
|
|
@ -9,6 +9,9 @@
|
|||
<!-- /resources/testharness.js -->
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<!-- Additional helper script for common checks across event types -->
|
||||
<script type="text/javascript" src="pointerevent_support.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
@ -38,6 +41,12 @@
|
|||
});
|
||||
test_pointerEvent.done(); // complete test
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerMove(0, 0)
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<style>
|
|
@ -6,6 +6,9 @@
|
|||
<meta name="viewport" content="width=device-width">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="pointerevent_support.js"></script>
|
||||
</head>
|
||||
<body onload="run()">
|
||||
|
@ -39,13 +42,19 @@
|
|||
on_event(target0, "pointerout", function (event) {
|
||||
pointeroutCounter++;
|
||||
|
||||
setTimeout(function() {
|
||||
step_timeout(function() {
|
||||
test(function() {
|
||||
assert_true(pointeroutCounter == 1, "pointerout received just once")
|
||||
}, "pointerout received just once");
|
||||
done();
|
||||
}, 5000);
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerMove(0, 0)
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<h1>Pointer Events pointerout received once test</h1>
|
|
@ -11,6 +11,9 @@
|
|||
<!-- /resources/testharness.js -->
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<!-- Additional helper script for common checks across event types -->
|
||||
<script type="text/javascript" src="pointerevent_support.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
@ -45,6 +48,14 @@
|
|||
detected_pointertypes[event.pointerType] = true;
|
||||
listener.setPointerCapture(event.pointerId);
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerDown()
|
||||
.pointerMove(10, 0, {origin: target0})
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
</head>
|
|
@ -6,6 +6,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="pointerevent_support.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -72,6 +75,14 @@
|
|||
event_log.push('pointerup@target0');
|
||||
pointerupGot = true;
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: captureButton})
|
||||
.pointerDown()
|
||||
.pointerMove(10, 0, {origin: target0})
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<h1>Pointer Events Capture Test</h1>
|
|
@ -6,6 +6,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="pointerevent_support.js"></script>
|
||||
<script type="text/javascript">
|
||||
var detected_pointertypes = {};
|
||||
|
@ -34,6 +37,13 @@
|
|||
}
|
||||
test_setPointerCapture.done();
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerDown()
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
</head>
|
|
@ -10,6 +10,9 @@
|
|||
<!-- /resources/testharness.js -->
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<!-- Additional helper script for common checks across event types -->
|
||||
<script type="text/javascript" src="pointerevent_support.js"></script>
|
||||
<script type="text/javascript">
|
||||
|
@ -35,6 +38,13 @@
|
|||
});
|
||||
test_pointerEvent.done(); // complete test
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerDown()
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
</head>
|
|
@ -6,6 +6,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script src="pointerevent_support.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -92,6 +95,16 @@
|
|||
event_log.push('pointerover@target1');
|
||||
}
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target1})
|
||||
.pointerMove(0, 0, {origin: captureButton})
|
||||
.pointerDown()
|
||||
.pointerMove(0, 0, {origin: target1})
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<h1>Pointer Events Capture Test</h1>
|
|
@ -8,6 +8,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script type="text/javascript" src="pointerevent_support.js"></script>
|
||||
<script type="text/javascript">
|
||||
var test_pointerEvent = async_test("Suppress compat mouse events on click");
|
||||
|
@ -60,6 +63,22 @@
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
var target0 = document.getElementById('target0');
|
||||
var target1 = document.getElementById('target1');
|
||||
var targetDone = document.getElementById('done');
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerDown()
|
||||
.pointerUp()
|
||||
.pointerMove(0, 0, {origin: target1})
|
||||
.pointerDown()
|
||||
.pointerUp()
|
||||
.pointerMove(0, 0, {origin: targetDone})
|
||||
.pointerDown()
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<style>
|
|
@ -8,6 +8,9 @@
|
|||
<link rel="stylesheet" type="text/css" href="pointerevent_styles.css">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/resources/testdriver.js"></script>
|
||||
<script src="/resources/testdriver-actions.js"></script>
|
||||
<script src="/resources/testdriver-vendor.js"></script>
|
||||
<script type="text/javascript" src="pointerevent_support.js"></script>
|
||||
<script type="text/javascript">
|
||||
var test_pointerEvent = async_test("Suppress compat mouse events on drag");
|
||||
|
@ -82,6 +85,24 @@
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
// Inject mouse inputs.
|
||||
var target0 = document.getElementById('target0');
|
||||
var target1 = document.getElementById('target1');
|
||||
var targetDone = document.getElementById('done');
|
||||
new test_driver.Actions()
|
||||
.pointerMove(0, 0, {origin: target0})
|
||||
.pointerDown()
|
||||
.pointerMove(10, 0, {origin: target0})
|
||||
.pointerUp()
|
||||
.pointerMove(0, 0, {origin: target1})
|
||||
.pointerDown()
|
||||
.pointerMove(10, 0, {origin: target1})
|
||||
.pointerUp()
|
||||
.pointerMove(0, 0, {origin: targetDone})
|
||||
.pointerDown()
|
||||
.pointerUp()
|
||||
.send();
|
||||
}
|
||||
</script>
|
||||
<style>
|
Загрузка…
Ссылка в новой задаче