Bug 1276831 - part2 : modify test. draft
authorAlastor Wu <alwu@mozilla.com>
Wed, 15 Jun 2016 16:51:23 +0100
changeset 378258 3abd7fedf39b22c9957baac8e99942e3bb87a81b
parent 378257 4c560ce6eb648b077997ec981ca001153e192650
child 378259 ad2c8997175355ef4e12bebaee26364ab1cd1927
push id20975
push useralwu@mozilla.com
push dateWed, 15 Jun 2016 15:52:52 +0000
bugs1276831
milestone50.0a1
Bug 1276831 - part2 : modify test. MozReview-Commit-ID: L7NF8Wu7dSF
dom/media/test/test_texttrackcue.html
--- a/dom/media/test/test_texttrackcue.html
+++ b/dom/media/test/test_texttrackcue.html
@@ -87,34 +87,37 @@ SpecialPowers.pushPrefEnv({"set": [["med
         video.removeEventListener("pause", pauseOnExit, false);
         video.play();
       });
 
       var exceptionHappened;
       function checkPercentageValue(prop, initialVal) {
         ok(prop in cue, prop + " should be a property on VTTCue.");
         cue[prop] = initialVal;
-        is(cue[prop], initialVal, "Cue's " + prop + " should now be " + initialVal);
+        is(cue[prop], initialVal, "Cue's " + prop + " should initially 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", 100.0);
       cue.size = 50.5;
       is(cue.size, 50.5, "Cue's size should be 50.5.")
 
-      checkPercentageValue("position", 50.0);
+      // Check cue.position
+      checkPercentageValue("position", "auto");
+      cue.position = 50.5;
+      is(cue.position, 50.5, "Cue's position value should now be 50.5.");
 
       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);