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

Unified Diff: third_party/WebKit/LayoutTests/inspector-protocol/input/emulateTouchFromMouseEvent.html

Issue 2961493002: [DevTools] Migrate inspector-protocol/{input,network} tests to new harness (Closed)
Patch Set: minor fixes Created 3 years, 6 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/LayoutTests/inspector-protocol/input/emulateTouchFromMouseEvent.html
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/input/emulateTouchFromMouseEvent.html b/third_party/WebKit/LayoutTests/inspector-protocol/input/emulateTouchFromMouseEvent.html
deleted file mode 100644
index f715471387407ad5de1431767d60ff3b4167d3ba..0000000000000000000000000000000000000000
--- a/third_party/WebKit/LayoutTests/inspector-protocol/input/emulateTouchFromMouseEvent.html
+++ /dev/null
@@ -1,130 +0,0 @@
-<html>
-<head>
-<script type="text/javascript" src="../../http/tests/inspector-protocol/resources/inspector-protocol-test.js"></script>
-<script>
-
-window.addEventListener("touchstart", logEvent, {passive: false});
-window.addEventListener("touchmove", logEvent, {passive: false});
-window.addEventListener("touchend", logEvent);
-window.addEventListener("touchcancel", logEvent);
-
-function logEvent(event)
-{
- event.preventDefault();
- log("-----Event-----");
- log("type: " + event.type);
- if (event.shiftKey)
- log("shiftKey");
- log("----Touches----");
- for (var i = 0; i < event.touches.length; i++) {
- var touch = event.touches[i];
- log("id: " + i);
- log("pageX: " + touch.pageX);
- log("pageY: " + touch.pageY);
- log("radiusX: " + touch.radiusX);
- log("radiusY: " + touch.radiusY);
- log("rotationAngle: " + touch.rotationAngle);
- log("force: " + touch.force);
- }
- evaluateInFrontend("onEvent();");
-}
-
-function test()
-{
- var events = [
- {
- "type": "mousePressed",
- "button": "left",
- "clickCount": 1,
- "x": 100,
- "y": 200
- },
- {
- "type": "mouseMoved",
- "button": "left",
- "clickCount": 1,
- "x": 100,
- "y": 250
- },
- {
- "type": "mouseReleased",
- "button": "left",
- "clickCount": 1,
- "x": 100,
- "y": 250
- },
- {
- "type": "mouseMoved",
- "button": "none",
- "modifiers": 8, // shift
- "x": 50,
- "y": 150
- },
- {
- "type": "mousePressed",
- "button": "left",
- "clickCount": 1,
- "x": 100,
- "y": 200
- },
- {
- "type": "mouseMoved",
- "button": "left",
- "clickCount": 1,
- "x": 100,
- "y": 250
- },
- {
- "type": "mouseReleased",
- "button": "left",
- "clickCount": 1,
- "x": 100,
- "y": 250
- }
- ];
-
- var time = Number(new Date()) / 1000;
- var index = 0;
-
- function sendNextEvent() {
- if (index === events.length) {
- maybeFinish();
- return;
- }
- var event = events[index];
- event.timestamp = time + index;
- index++;
- InspectorTest.sendCommand("Input.emulateTouchFromMouseEvent", event, checkResponse);
- }
-
- function checkResponse(msg)
- {
- if (msg.error)
- InspectorTest.log("Error: " + msg.error.message);
- sendNextEvent();
- }
-
- const expectedEventCount = 6;
- var eventCount = 0;
- window.onEvent = function()
- {
- eventCount++;
- maybeFinish();
- };
-
- function maybeFinish()
- {
- if (index === events.length && eventCount === expectedEventCount)
- InspectorTest.completeTest();
- }
-
- InspectorTest.sendCommand("Page.enable", {}, function() {
- InspectorTest.sendCommand("Page.setTouchEmulationEnabled", { enabled: true }, sendNextEvent);
- });
-}
-
-</script>
-</head>
-<body onload="runTest()">
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698