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 324307 e4f46b2740b68703ac8fdcbc8871f889de5cbad8
parent 324306 19c3f546ee34a93f7b8964bd2435f1d4784520f4
child 324308 25836ab7cdbc8983d5aec6e3b45adf2ea5007eb1
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersbaku
bugs1270738, 1240423
milestone53.0a1
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();
 }