Add a way to reset the eventTrigger in ControlsTest in LayoutTests/media/controls...
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Apr 2016 18:15:04 +0000 (18:15 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Apr 2016 18:15:04 +0000 (18:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154616

Reviewed by Dean Jackson.

* media/controls/controls-test-helpers.js:
(ControlsTest.prototype.resetEventTrigger):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198949 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/media/controls/controls-test-helpers.js

index 323f503..8646844 100644 (file)
@@ -1,3 +1,13 @@
+2016-04-01  Ada Chan  <adachan@apple.com>
+
+        Add a way to reset the eventTrigger in ControlsTest in LayoutTests/media/controls/controls-test-helpers.js
+        https://bugs.webkit.org/show_bug.cgi?id=154616
+
+        Reviewed by Dean Jackson.
+
+        * media/controls/controls-test-helpers.js:
+        (ControlsTest.prototype.resetEventTrigger):
+
 2016-04-01  Ryan Haddad  <ryanhaddad@apple.com>
 
         Marking three media controls tests as flaky on El Capitan
index 5942d91..cf99631 100644 (file)
@@ -21,6 +21,19 @@ ControlsTest = class ControlsTest {
         return this;
     }
 
+    resetEventTrigger(eventTrigger)
+    {
+        if (this.eventTrigger && this.media)
+            this.media.removeEventListener(this.eventTrigger, this, false);
+
+        this.eventTrigger = eventTrigger;
+        if (!this.media)
+            return null;
+
+        this.media.addEventListener(this.eventTrigger, this, false);
+        return this;
+    }
+
     get currentState()
     {
         if (!this.media)