Bug 1191123 - Make sure that DOMAudioPlaybackStarted/Stopped events are not cancelable; r=smaug
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 04 Aug 2015 19:19:20 -0400
changeset 287912 da8ddcb7254eaef460ab9b0a20c14aa67bb295dc
parent 287911 f951ca5e6d7cafbe2fdbcdaea68d51ec542e2fa3
child 287913 9def245f34d2f1a12697bebd94a3a433b150959f
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1191123
milestone42.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 1191123 - Make sure that DOMAudioPlaybackStarted/Stopped events are not cancelable; r=smaug
toolkit/content/tests/browser/browser_mediaPlayback.js
toolkit/content/widgets/browser.xml
--- a/toolkit/content/tests/browser/browser_mediaPlayback.js
+++ b/toolkit/content/tests/browser/browser_mediaPlayback.js
@@ -1,14 +1,15 @@
 const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_mediaPlayback.html";
 const FRAME = "https://example.com/browser/toolkit/content/tests/browser/file_mediaPlaybackFrame.html";
 
 function wait_for_event(browser, event) {
   return BrowserTestUtils.waitForEvent(browser, event, false, (event) => {
     is(event.originalTarget, browser, "Event must be dispatched to correct browser.");
+    ok(!event.cancelable, "The event should not be cancelable");
     return true;
   });
 }
 
 function* test_on_browser(url, browser) {
   browser.loadURI(url);
   yield wait_for_event(browser, "DOMAudioPlaybackStarted");
   yield wait_for_event(browser, "DOMAudioPlaybackStopped");
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -662,27 +662,27 @@
       <property name="pageReport"
          onget="return this.blockedPopups;"
          readonly="true"/>
 
       <method name="audioPlaybackStarted">
         <body>
           <![CDATA[
             let event = document.createEvent("Events");
-            event.initEvent("DOMAudioPlaybackStarted", true, true);
+            event.initEvent("DOMAudioPlaybackStarted", true, false);
             this.dispatchEvent(event);
           ]]>
         </body>
       </method>
 
       <method name="audioPlaybackStopped">
         <body>
           <![CDATA[
             let event = document.createEvent("Events");
-            event.initEvent("DOMAudioPlaybackStopped", true, true);
+            event.initEvent("DOMAudioPlaybackStopped", true, false);
             this.dispatchEvent(event);
           ]]>
         </body>
       </method>
 
       <field name="_audioMuted">false</field>
       <property name="audioMuted"
                 onget="return this._audioMuted;"