Bug 1270738 - Don't need to check the playing state for 'test_audioNotificationSilent_audioFile.html'. r=baku
authorAlastor Wu <alwu@mozilla.com>
Mon, 21 Nov 2016 11:25:10 +0800
changeset 358976 27d1cc81b04b5173d2f6d7189d26cd91e0bc3805
parent 358975 0742e181e22f650c7c4f18a72489665b28e90129
child 358977 79b38ed0205608377d67bbe2f017996de80227f4
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbaku
bugs1270738, 1240423
milestone51.0
Bug 1270738 - Don't need to check the playing state for 'test_audioNotificationSilent_audioFile.html'. r=baku The reason to check the playing state is because we want to make sure the non-audible event is not due to media element ended. However, in bug 1240423, we introduced the different inactive state (inactive-pause and inactive-nonaudible), so we don't need to check the playing state anymore, we can just check whether the event is 'inactive-nonaudible', but not 'inactive-pause'. MozReview-Commit-ID: 6slOhb68Qp5
dom/base/test/test_audioNotificationSilent_audioFile.html
--- a/dom/base/test/test_audioNotificationSilent_audioFile.html
+++ b/dom/base/test/test_audioNotificationSilent_audioFile.html
@@ -7,29 +7,27 @@
 </head>
 <body>
 <script type="application/javascript;version=1.7">
 
 SimpleTest.waitForExplicitFinish();
 
 var generator = runTest();
 var expectedPlaybackActive = null;
-var expectedPlaying = null;
 
 var audio = new Audio();
 audio.src = "audioEndedDuringPlaying.webm";
 
 var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
                                    .getService(SpecialPowers.Ci.nsIObserverService);
 
 var observer = {
   observe: function(subject, topic, data) {
     is(topic, "audio-playback", "audio-playback received");
     is(data, expectedPlaybackActive, "Corrrect audible state");
-    is(!audio.ended, expectedPlaying, "Corrrect playing state");
     continueTest();
   }
 };
 
 function continueTest() {
   try {
     generator.next();
   } catch (e if e instanceof StopIteration) {
@@ -37,27 +35,25 @@ function continueTest() {
   }
 }
 
 function audioPlayingStart() {
   observerService.addObserver(observer, "audio-playback", false);
   ok(true, "Observer set");
 
   expectedPlaybackActive = 'active';
-  expectedPlaying = true;
 
   info("Audio playing start");
   audio.play();
 }
 
 function audioBecomeSilentDuringPlaying() {
   info("Audio would become silent during playing");
 
   expectedPlaybackActive = 'inactive-nonaudible';
-  expectedPlaying = true;
 }
 
 function finish() {
   observerService.removeObserver(observer, "audio-playback");
   ok(true, "Observer removed");
 
   SimpleTest.finish();
 }