Bug 1276833 - part2 : modify test. r=rillian
authorAlastor Wu <alwu@mozilla.com>
Tue, 14 Jun 2016 11:51:48 +0100
changeset 301724 6c5a862618c4ad00df5bdccadc47c9da709a107f
parent 301723 e7c14498436f09e681e9349c90f8f87cb6ed250a
child 301725 568a08748f673064b01377cfe75785990c84aafa
push id78425
push useralwu@mozilla.com
push dateTue, 14 Jun 2016 10:54:46 +0000
treeherdermozilla-inbound@6c5a862618c4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrillian
bugs1276833
milestone50.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 1276833 - part2 : modify test. r=rillian MozReview-Commit-ID: 27N9am5Lb5K
dom/media/test/test_texttrackcue.html
--- a/dom/media/test/test_texttrackcue.html
+++ b/dom/media/test/test_texttrackcue.html
@@ -84,34 +84,37 @@ SpecialPowers.pushPrefEnv({"set": [["med
       cue.pauseOnExit = true;
       is(cue.pauseOnExit, true, "Cue's pause on exit flag should be true.");
       video.addEventListener("pause", function pauseOnExit() {
         video.removeEventListener("pause", pauseOnExit, false);
         video.play();
       });
 
       var exceptionHappened;
-      function checkPercentageValue(prop) {
+      function checkPercentageValue(prop, initialVal) {
         ok(prop in cue, prop + " should be a property on VTTCue.");
-        cue[prop] = 20;
-        is(cue[prop], 20, "Cue's " + prop + " should now be 20.");
+        cue[prop] = initialVal;
+        is(cue[prop], initialVal, "Cue's " + prop + " should now be " + initialVal);
         [ 101, -1 ].forEach(function(val) {
           exceptionHappened = false;
           try {
             cue[prop] = val;
           } catch(e) {
             exceptionHappened = true;
             is(e.name, "IndexSizeError", "Should have thrown IndexSizeError.");
           }
           ok(exceptionHappened, "Exception should have happened.");
         });
       }
 
-      checkPercentageValue("size");
-      checkPercentageValue("position");
+      checkPercentageValue("size", 100.0);
+      cue.size = 50.5;
+      is(cue.size, 50.5, "Cue's size should be 50.5.")
+
+      checkPercentageValue("position", 50.0);
 
       ok(cue.snapToLines, "Cue's snapToLines should be set by set.");
       cue.snapToLines = false;
       ok(!cue.snapToLines, "Cue's snapToLines should not be set.");
 
       function checkEnumValue(prop, initialVal, acceptedValues) {
         ok(prop in cue, prop + " should be a property on VTTCue.");
         is(cue[prop], initialVal, "Cue's " + prop + " should be " + initialVal);