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

Unified Diff: LayoutTests/fast/speech/speech-button-ignore-generated-events.html

Issue 264973003: Remove layout tests for the legacy x-webkit-speech API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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/speech/speech-button-ignore-generated-events.html
diff --git a/LayoutTests/fast/speech/speech-button-ignore-generated-events.html b/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
deleted file mode 100644
index 1e801c133bf50e62cc88bfcc12e744a63df14cd6..0000000000000000000000000000000000000000
--- a/LayoutTests/fast/speech/speech-button-ignore-generated-events.html
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src="../../resources/js-test.js"></script>
-</head>
-<body>
-<script type="text/javascript">
-description('Tests that the speech button ignores programmatic click events.');
-
-function sendClick(useEventSender) {
- var input = document.getElementById('speechInput');
- var clientX = input.offsetWidth - 4;
- var clientY = input.offsetHeight / 2;
- var pageX = input.offsetLeft + clientX;
- var pageY = input.offsetTop + clientY;
- if (useEventSender) {
- eventSender.mouseMoveTo(pageX, pageY);
- eventSender.mouseDown();
- eventSender.mouseUp();
- } else {
- var event = document.createEvent("MouseEvents");
- event.initMouseEvent('click', true, true, window, 1, pageX, pageY, clientX, clientY,
- false, false, false, false, 0, document);
- input.dispatchEvent(event);
- }
-}
-
-function setupDispatchEventTest() {
- document.getElementById('speechInput').onwebkitspeechchange = function() {
- testFailed('speech button accepted a programmatic click and fired onChange event.');
- finishJSTest();
- };
- setTimeout(function() {
- testPassed('speech button ignored the programmatic click event.');
- finishJSTest();
- }, 1000);
- sendClick(false);
-}
-
-// In this test, we first send a click via the eventSender interface which is available only
-// within our test environment. This mimics a real user input event and hence the speech button
-// should treat it normally. We'll be receiving the mock recognition result and verify that.
-// Next we send a generated click event via the dispatchEvent interface which is available
-// for any web page to use. The speech button should identify that this is not a real user
-// input event and not process it.
-function run() {
- if (window.testRunner && window.eventSender) {
- // Running in DRT, test the eventSender case.
- testRunner.addMockSpeechInputResult('Pictures of the moon', 1.0, '');
- document.getElementById('speechInput').onwebkitspeechchange = function() {
- shouldBeEqualToString('document.getElementById("speechInput").value', 'Pictures of the moon');
-
- // The speech button is still in the processing state and does not accept clicks. So ask for
- // a callback once it has processed pending events before sending a programmatic click.
- setTimeout(setupDispatchEventTest, 0);
- };
- sendClick(true);
- } else {
- setupDispatchEventTest();
- }
-}
-
-window.onload = run;
-window.jsTestIsAsync = true;
-</script>
-<input id='speechInput' x-webkit-speech>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698