<!DOCTYPE html>
<html>
<head>
    <script src="../../resources/js-test.js"></script>
</head>
<body>
    <script>
        description("Verify that TextTrackCue exceptions are properly messaged to developers.");

        var cue = new TextTrackCue(0, 0, "Test.");

        function testInfinityAndNaN(property) {
            shouldThrow("cue." + property + " = Number.NaN;");
            shouldThrow("cue." + property + " = Number.POSITIVE_INFINITY;");
            shouldThrow("cue." + property + " = Number.NEGATIVE_INFINITY;");
        }

        function testPercentage(property) {
            shouldThrow("cue." + property + " = -1;");
            shouldThrow("cue." + property + " = 101;");
        }

        testInfinityAndNaN("startTime");
        testInfinityAndNaN("endTime");

        shouldThrow("cue.vertical = 'Invalid!';");

        cue.snapToLines = false;
        testPercentage("line");

        testPercentage("position");
        testPercentage("size");

        shouldThrow("cue.align = 'Invalid!';");
    </script>
</body>
</html>

<!DOCTYPE html>
<html>
<head>
    <script src="../../resources/js-test.js"></script>
</head>
<body>
    <script>
        description("Verify that TextTrackCue exceptions are properly messaged to developers.");

        var cue = new VTTCue(0, 0, "Test.");

        function testInfinityAndNaN(property) {
            shouldThrow("cue." + property + " = Number.NaN;");
            shouldThrow("cue." + property + " = Number.POSITIVE_INFINITY;");
            shouldThrow("cue." + property + " = Number.NEGATIVE_INFINITY;");
        }

        function testPercentage(property) {
            shouldThrow("cue." + property + " = -1;");
            shouldThrow("cue." + property + " = 101;");
        }

        testInfinityAndNaN("startTime");
        testInfinityAndNaN("endTime");

        shouldThrow("cue.vertical = 'Invalid!';");

        cue.snapToLines = false;
        testPercentage("line");

        testPercentage("position");
        testPercentage("size");

        shouldThrow("cue.align = 'Invalid!';");
    </script>
</body>
</html>

Use the VTTCue constructor instead of TextTrackCue in test
Use the VTTCue constructor instead of TextTrackCue in test

The TextTrackCue constructor is being deprecated.

BUG=334942

Review URL: https://codereview.chromium.org/140563002

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@165199 bbb929c8-8fbe-4397-9dbb-9b2b20218538
