Bug 1276833 - part2 : modify test. draft
authorAlastor Wu <alwu@mozilla.com>
Tue, 14 Jun 2016 11:51:48 +0100
changeset 377959 fbd2531154405fa94f6c0162e0d140ab4908f0c9
parent 377958 e5e2cbd6373934a29f24f967db72108de5a8403f
child 377961 b5872fcefa022081a9382ce427d98718fa5e72d7
child 378050 7a76b947259d5900e8856b1fe6df17858768f89c
child 378066 ff39e6729a0f14b63a293fe3ef76de80c2fbc730
push id20904
push useralwu@mozilla.com
push dateTue, 14 Jun 2016 10:51:57 +0000
bugs1276833
milestone50.0a1
Bug 1276833 - part2 : modify test. 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);