Bug 1507627 [wpt PR 14081] - Replace general source type with none source type, a=testonly
authorNavid Zolghadr <nzolghadr@chromium.org>
Tue, 27 Nov 2018 20:11:58 +0000
changeset 505155 33848f48c13677e4deaf92fbf734ef925e0da8bb
parent 505154 dad19f5060770ae8e9d5042b8e218a25fd49a5f8
child 505156 e93fd4f50dd100d515cc84b92832b9e9fa5889bc
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1507627, 14081
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507627 [wpt PR 14081] - Replace general source type with none source type, a=testonly Automatic update from web-platform-testsReplace general source type with none source type (#14081) * Replace general source type with none source type Based on the web driver spec the general source type string should be "none". https://w3c.github.io/webdriver/#input-source-state * Add a test * Rename the test title, move to promise test, set expectation for Chrome -- wpt-commits: c6d4a3c8d42294787a54c9667675873c224e3e1a wpt-pr: 14081
testing/web-platform/tests/infrastructure/metadata/infrastructure/testdriver/actions/pause.html.ini
testing/web-platform/tests/infrastructure/testdriver/actions/pause.html
testing/web-platform/tests/resources/testdriver-actions.js
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/infrastructure/metadata/infrastructure/testdriver/actions/pause.html.ini
@@ -0,0 +1,3 @@
+[pause.html]
+  expected:
+    if product == "chrome" or product == "safari" or product == "safari_webdriver": ERROR
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/infrastructure/testdriver/actions/pause.html
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>TestDriver actions: pause</title>
+<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>
+promise_test(() => {
+  let t0 = performance.now();
+  return new test_driver.Actions()
+    .addTick(1000)
+    .send()
+    .then(() => assert_greater_than(performance.now() - t0, 1000));
+})
+</script>
--- a/testing/web-platform/tests/resources/testdriver-actions.js
+++ b/testing/web-platform/tests/resources/testdriver-actions.js
@@ -2,27 +2,27 @@
   let sourceNameIdx = 0;
 
   /**
    * Builder for creating a sequence of actions
    */
   function Actions() {
     this.sourceTypes = new Map([["key", KeySource],
                                 ["pointer", PointerSource],
-                                ["general", GeneralSource]]);
+                                ["none", GeneralSource]]);
     this.sources = new Map();
     this.sourceOrder = [];
     for (let sourceType of this.sourceTypes.keys()) {
       this.sources.set(sourceType, new Map());
     }
     this.currentSources = new Map();
     for (let sourceType of this.sourceTypes.keys()) {
       this.currentSources.set(sourceType, null);
     }
-    this.createSource("general");
+    this.createSource("none");
     this.tickIdx = 0;
   }
 
   Actions.prototype = {
     /**
      * Generate the action sequence suitable for passing to
      * test_driver.action_sequence
      *
@@ -57,17 +57,17 @@
       return test_driver.action_sequence(actions);
     },
 
     /**
      * Get the action source with a particular source type and name.
      * If no name is passed, a new source with the given type is
      * created.
      *
-     * @param {String} type - Source type ('general', 'key', or 'pointer')
+     * @param {String} type - Source type ('none', 'key', or 'pointer')
      * @param {String?} name - Name of the source
      * @returns {Source} Source object for that source.
      */
     getSource: function(type, name) {
       if (!this.sources.has(type)) {
         throw new Error(`${type} is not a valid action type`);
       }
       if (name === null || name === undefined) {
@@ -182,17 +182,17 @@
 
     /**
      * Add a pause to the current tick
      *
      * @param {Number?} duration - Minimum length of the tick in ms.
      * @returns {Actions}
      */
     pause: function(duration) {
-      this.getSource("general").addPause(this, duration);
+      this.getSource("none").addPause(this, duration);
       return this;
     },
 
     /**
      * Create a keyDown event for the current default key source
      *
      * @param {String} key - Key to press
      * @param {String?} sourceName - Named key source to use or null for the default key source