Changeset 147969 in webkit


Ignore:
Timestamp:
Apr 8, 2013 5:45:28 PM (11 years ago)
Author:
commit-queue@webkit.org
Message:

Tests for exceptions of type DOMException.TYPE_ERR in encrypted-media-syntax.html are broken
https://bugs.webkit.org/show_bug.cgi?id=113119

Renames testException() to testDOMException() and tweaks the check.
Also adds a new testException() helper for checking non-DOM exceptions.

Patch by Steve Block <steveblock@chromium.org> on 2013-04-08
Reviewed by Darin Adler.

  • media/encrypted-media/encrypted-media-not-loaded.html:
  • media/encrypted-media/encrypted-media-syntax-expected.txt:
  • media/encrypted-media/encrypted-media-syntax.html:
  • media/encrypted-media/encrypted-media-v2-syntax.html:
  • media/media-fullscreen.js:

(buttonClickHandler):
(canplaythrough):

  • media/track/track-add-remove-cue.html:
  • media/track/track-addtrack-kind.html:
  • media/track/track-cue-mutable.html:
  • media/video-buffered.html:
  • media/video-play-require-user-gesture.html:
  • media/video-seek-no-src-exception.html:
  • media/video-seekable.html:
  • media/video-test.js:

(testDOMException):

  • media/video-volume.html:
Location:
trunk/LayoutTests
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r147968 r147969  
     12013-04-08  Steve Block  <steveblock@chromium.org>
     2
     3        Tests for exceptions of type DOMException.TYPE_ERR in encrypted-media-syntax.html are broken
     4        https://bugs.webkit.org/show_bug.cgi?id=113119
     5
     6        Renames testException() to testDOMException() and tweaks the check.
     7        Also adds a new testException() helper for checking non-DOM exceptions.
     8
     9        Reviewed by Darin Adler.
     10
     11        * media/encrypted-media/encrypted-media-not-loaded.html:
     12        * media/encrypted-media/encrypted-media-syntax-expected.txt:
     13        * media/encrypted-media/encrypted-media-syntax.html:
     14        * media/encrypted-media/encrypted-media-v2-syntax.html:
     15        * media/media-fullscreen.js:
     16        (buttonClickHandler):
     17        (canplaythrough):
     18        * media/track/track-add-remove-cue.html:
     19        * media/track/track-addtrack-kind.html:
     20        * media/track/track-cue-mutable.html:
     21        * media/video-buffered.html:
     22        * media/video-play-require-user-gesture.html:
     23        * media/video-seek-no-src-exception.html:
     24        * media/video-seekable.html:
     25        * media/video-test.js:
     26        (testDOMException):
     27        * media/video-volume.html:
     28
    1292013-04-08  Brady Eidson  <beidson@apple.com>
    230
  • trunk/LayoutTests/media/encrypted-media/encrypted-media-not-loaded.html

    r113736 r147969  
    3030
    3131            consoleWrite("No 'src'. Verify that all methods except canPlayType() throw INVALID_STATE_ERR.");
    32             testException("video.webkitGenerateKeyRequest('webkit-org.w3.clearkey')", "DOMException.INVALID_STATE_ERR");
    33             testException("video.webkitAddKey('webkit-org.w3.clearkey', key)", "DOMException.INVALID_STATE_ERR");
    34             testException("video.webkitCancelKeyRequest('webkit-org.w3.clearkey')", "DOMException.INVALID_STATE_ERR");
     32            testDOMException("video.webkitGenerateKeyRequest('webkit-org.w3.clearkey')", "DOMException.INVALID_STATE_ERR");
     33            testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', key)", "DOMException.INVALID_STATE_ERR");
     34            testDOMException("video.webkitCancelKeyRequest('webkit-org.w3.clearkey')", "DOMException.INVALID_STATE_ERR");
    3535            run("video.canPlayType('audio/wav', 'webkit-org.w3.clearkey')");
    3636
     
    4242            testExpected("video.currentSrc", "");
    4343
    44             testException("video.webkitGenerateKeyRequest('webkit-org.w3.clearkey')", "DOMException.INVALID_STATE_ERR");
    45             testException("video.webkitAddKey('webkit-org.w3.clearkey', key)", "DOMException.INVALID_STATE_ERR");
    46             testException("video.webkitCancelKeyRequest('webkit-org.w3.clearkey')", "DOMException.INVALID_STATE_ERR");
     44            testDOMException("video.webkitGenerateKeyRequest('webkit-org.w3.clearkey')", "DOMException.INVALID_STATE_ERR");
     45            testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', key)", "DOMException.INVALID_STATE_ERR");
     46            testDOMException("video.webkitCancelKeyRequest('webkit-org.w3.clearkey')", "DOMException.INVALID_STATE_ERR");
    4747            run("video.canPlayType('audio/wav', 'webkit-org.w3.clearkey')");
    4848
  • trunk/LayoutTests/media/encrypted-media/encrypted-media-syntax-expected.txt

    r134440 r147969  
    22
    33Test calling functions with too few parameters.
    4 TEST(video.webkitGenerateKeyRequest()) THROWS(DOMException.TYPE_ERR) OK
    5 TEST(video.webkitAddKey()) THROWS(DOMException.TYPE_ERR) OK
    6 TEST(video.webkitAddKey('webkit-org.w3.clearkey')) THROWS(DOMException.TYPE_ERR) OK
    7 TEST(video.webkitCancelKeyRequest()) THROWS(DOMException.TYPE_ERR) OK
     4TEST(video.webkitGenerateKeyRequest()) THROWS("TypeError: Not enough arguments") OK
     5TEST(video.webkitAddKey()) THROWS("TypeError: Not enough arguments") OK
     6TEST(video.webkitAddKey('webkit-org.w3.clearkey')) THROWS("TypeError: Not enough arguments") OK
     7TEST(video.webkitCancelKeyRequest()) THROWS("TypeError: Not enough arguments") OK
    88
    99Verify invalid key system parameter is caught before checking whether loading has started.
  • trunk/LayoutTests/media/encrypted-media/encrypted-media-syntax.html

    r134440 r147969  
    2828
    2929                consoleWrite("<br>Unsupported key systems result in NOT_SUPPORTED_ERR.");
    30                 testException("video.webkitGenerateKeyRequest('com.example.invalid')", "DOMException.NOT_SUPPORTED_ERR");
    31                 testException("video.webkitAddKey('com.example.invalid', key)", "DOMException.NOT_SUPPORTED_ERR");
    32                 testException("video.webkitCancelKeyRequest('com.example.invalid')", "DOMException.NOT_SUPPORTED_ERR");
     30                testDOMException("video.webkitGenerateKeyRequest('com.example.invalid')", "DOMException.NOT_SUPPORTED_ERR");
     31                testDOMException("video.webkitAddKey('com.example.invalid', key)", "DOMException.NOT_SUPPORTED_ERR");
     32                testDOMException("video.webkitCancelKeyRequest('com.example.invalid')", "DOMException.NOT_SUPPORTED_ERR");
    3333
    3434                endTest();
     
    3636       
    3737            consoleWrite("Test calling functions with too few parameters.");
    38             testException("video.webkitGenerateKeyRequest()", "DOMException.TYPE_ERR");
    39             testException("video.webkitAddKey()", "DOMException.TYPE_ERR");
    40             testException("video.webkitAddKey('webkit-org.w3.clearkey')", "DOMException.TYPE_ERR");
    41             testException("video.webkitCancelKeyRequest()", "DOMException.TYPE_ERR");
     38            var notEnoughArgumentsException = '"TypeError: Not enough arguments"';
     39            testException("video.webkitGenerateKeyRequest()", notEnoughArgumentsException);
     40            testException("video.webkitAddKey()", notEnoughArgumentsException);
     41            testException("video.webkitAddKey('webkit-org.w3.clearkey')", notEnoughArgumentsException);
     42            testException("video.webkitCancelKeyRequest()", notEnoughArgumentsException);
    4243
    4344            consoleWrite("<br>Verify invalid key system parameter is caught before checking whether loading has started.");
     
    4647            testExpected("video.networkState", video.NETWORK_EMPTY);
    4748            testExpected("video.currentSrc", "");
    48             testException("video.webkitGenerateKeyRequest('')", "DOMException.SYNTAX_ERR");
    49             testException("video.webkitGenerateKeyRequest(null)", "DOMException.SYNTAX_ERR");
    50             testException("video.webkitGenerateKeyRequest(undefined)", "DOMException.SYNTAX_ERR");
    51             testException("video.webkitAddKey('', key)", "DOMException.SYNTAX_ERR");
    52             testException("video.webkitAddKey(null, key)", "DOMException.SYNTAX_ERR");
    53             testException("video.webkitAddKey(undefined, key)", "DOMException.SYNTAX_ERR");
    54             testException("video.webkitCancelKeyRequest('')", "DOMException.SYNTAX_ERR");
    55             testException("video.webkitCancelKeyRequest(null)", "DOMException.SYNTAX_ERR");
    56             testException("video.webkitCancelKeyRequest(undefined)", "DOMException.SYNTAX_ERR");
     49            testDOMException("video.webkitGenerateKeyRequest('')", "DOMException.SYNTAX_ERR");
     50            testDOMException("video.webkitGenerateKeyRequest(null)", "DOMException.SYNTAX_ERR");
     51            testDOMException("video.webkitGenerateKeyRequest(undefined)", "DOMException.SYNTAX_ERR");
     52            testDOMException("video.webkitAddKey('', key)", "DOMException.SYNTAX_ERR");
     53            testDOMException("video.webkitAddKey(null, key)", "DOMException.SYNTAX_ERR");
     54            testDOMException("video.webkitAddKey(undefined, key)", "DOMException.SYNTAX_ERR");
     55            testDOMException("video.webkitCancelKeyRequest('')", "DOMException.SYNTAX_ERR");
     56            testDOMException("video.webkitCancelKeyRequest(null)", "DOMException.SYNTAX_ERR");
     57            testDOMException("video.webkitCancelKeyRequest(undefined)", "DOMException.SYNTAX_ERR");
    5758
    5859            consoleWrite("<br>null key is caught before load state is checked.");
    59             testException("video.webkitAddKey('webkit-org.w3.clearkey', '')", "DOMException.SYNTAX_ERR");
    60             testException("video.webkitAddKey('webkit-org.w3.clearkey', null)", "DOMException.SYNTAX_ERR");
    61             testException("video.webkitAddKey('webkit-org.w3.clearkey', undefined)", "DOMException.SYNTAX_ERR");
     60            testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', '')", "DOMException.SYNTAX_ERR");
     61            testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', null)", "DOMException.SYNTAX_ERR");
     62            testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', undefined)", "DOMException.SYNTAX_ERR");
    6263
    6364            consoleWrite("<br>0-length key is caught before load state is checked.");
    64             testException("video.webkitAddKey('webkit-org.w3.clearkey', new Uint8Array())", "DOMException.TYPE_MISMATCH_ERR");
     65            testDOMException("video.webkitAddKey('webkit-org.w3.clearkey', new Uint8Array())", "DOMException.TYPE_MISMATCH_ERR");
    6566
    6667            consoleWrite("<br>Key system validity is not checked before loading.");
    67             testException("video.webkitGenerateKeyRequest('com.example.invalid')", "DOMException.INVALID_STATE_ERR");
    68             testException("video.webkitAddKey('com.example.invalid', key)", "DOMException.INVALID_STATE_ERR");
    69             testException("video.webkitCancelKeyRequest('com.example.invalid')", "DOMException.INVALID_STATE_ERR");
     68            testDOMException("video.webkitGenerateKeyRequest('com.example.invalid')", "DOMException.INVALID_STATE_ERR");
     69            testDOMException("video.webkitAddKey('com.example.invalid', key)", "DOMException.INVALID_STATE_ERR");
     70            testDOMException("video.webkitCancelKeyRequest('com.example.invalid')", "DOMException.INVALID_STATE_ERR");
    7071
    7172            // FIXME(82952): Add "test-encrypted" file.
  • trunk/LayoutTests/media/encrypted-media/encrypted-media-v2-syntax.html

    r142918 r147969  
    2727                consoleWrite("Test MediaKeys.");
    2828                testExpected('typeof window.MediaKeys', 'object');
    29                 testException('new MediaKeys("")', "DOMException.INVALID_ACCESS_ERR");
    30                 testException('new MediaKeys("unsupported")', "DOMException.NOT_SUPPORTED_ERR");
     29                testDOMException('new MediaKeys("")', "DOMException.INVALID_ACCESS_ERR");
     30                testDOMException('new MediaKeys("unsupported")', "DOMException.NOT_SUPPORTED_ERR");
    3131                run('mediaKeys = new MediaKeys("com.webcore.mock")');
    3232                testExpected('mediaKeys.keySystem', 'com.webcore.mock');
    3333                testExpected('typeof mediaKeys.createSession', 'function');
    34                 testException('mediaKeys.createSession("", new Uint8Array(1))', "DOMException.INVALID_ACCESS_ERR");
    35                 testException('mediaKeys.createSession("unsupported/type")', "DOMException.NOT_SUPPORTED_ERR");
     34                testDOMException('mediaKeys.createSession("", new Uint8Array(1))', "DOMException.INVALID_ACCESS_ERR");
     35                testDOMException('mediaKeys.createSession("unsupported/type")', "DOMException.NOT_SUPPORTED_ERR");
    3636                consoleWrite("");
    3737
     
    4747                testExpected('mediaKeySession.onwebkitkeyerror', null);
    4848                testExpected('mediaKeySession.onwebkitkeymessage', null);
    49                 testException('mediaKeySession.update(null)', "DOMException.INVALID_ACCESS_ERR");
     49                testDOMException('mediaKeySession.update(null)', "DOMException.INVALID_ACCESS_ERR");
    5050                endTest();
    5151            }
  • trunk/LayoutTests/media/media-fullscreen.js

    r120416 r147969  
    1414    else {
    1515        if (movie.type == 'video')
    16             testException("mediaElement.webkitEnterFullScreen()", "DOMException.INVALID_STATE_ERR");
     16            testDOMException("mediaElement.webkitEnterFullScreen()", "DOMException.INVALID_STATE_ERR");
    1717        openNextMovie();
    1818    }
     
    6464    // called in response to a user gesture.
    6565    if (movie.type == 'video')
    66         testException("mediaElement.webkitEnterFullScreen()", "DOMException.INVALID_STATE_ERR");
     66        testDOMException("mediaElement.webkitEnterFullScreen()", "DOMException.INVALID_STATE_ERR");
    6767
    6868    // Click on the button
  • trunk/LayoutTests/media/track/track-add-remove-cue.html

    r136026 r147969  
    8686
    8787                consoleWrite("<br>*** Try to remove the cue again.");
    88                 testException("testTrack.track.removeCue(textCue)", "DOMException.NOT_FOUND_ERR");
     88                testDOMException("testTrack.track.removeCue(textCue)", "DOMException.NOT_FOUND_ERR");
    8989
    9090                consoleWrite("<br>*** Add a cue before all the existing cues.");
  • trunk/LayoutTests/media/track/track-addtrack-kind.html

    r106361 r147969  
    2222                consoleWrite("<em>++ Test invalid 'kind'.</em>");
    2323                testExpected("video.textTracks.length", 0);
    24                 testException("video.addTextTrack('kaptions')", "DOMException.SYNTAX_ERR");
     24                testDOMException("video.addTextTrack('kaptions')", "DOMException.SYNTAX_ERR");
    2525                testExpected("video.textTracks.length", 0);
    2626                consoleWrite("");
  • trunk/LayoutTests/media/track/track-cue-mutable.html

    r108872 r147969  
    4949                logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-vertical",
    5050                           "On setting, the text track cue writing direction must be set to the value ... is a case-sensitive match for the new value, if any. If none of the values match, then the user agent must instead throw a SyntaxError exception.");
    51                 testException("textCue.vertical = 'RL'", "DOMException.SYNTAX_ERR");
     51                testDOMException("textCue.vertical = 'RL'", "DOMException.SYNTAX_ERR");
    5252                testExpected("textCue.vertical", "");
    5353                run("textCue.vertical = 'rl'");
     
    6060                logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line",
    6161                            "On setting, if the text track cue snap-to-lines flag is not set, and the new value is negative or greater than 100, then throw an IndexSizeError exception.");
    62                 testException("textCue.line = -2", "DOMException.INDEX_SIZE_ERR");
    63                 testException("textCue.line = 102", "DOMException.INDEX_SIZE_ERR");
     62                testDOMException("textCue.line = -2", "DOMException.INDEX_SIZE_ERR");
     63                testDOMException("textCue.line = 102", "DOMException.INDEX_SIZE_ERR");
    6464                testExpected("textCue.line", -1);
    6565                run("textCue.line = 42");
     
    7373                logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-line",
    7474                           "On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. Otherwise, set the text track cue text position to the new value.");
    75                 testException("textCue.position = -200", "DOMException.INDEX_SIZE_ERR");
    76                 testException("textCue.position = 110", "DOMException.INDEX_SIZE_ERR");
     75                testDOMException("textCue.position = -200", "DOMException.INDEX_SIZE_ERR");
     76                testDOMException("textCue.position = 110", "DOMException.INDEX_SIZE_ERR");
    7777                run("textCue.position = 11");
    7878                testExpected("textCue.position", 11);
     
    8080                logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-size",
    8181                           "On setting, if the new value is negative or greater than 100, then throw an IndexSizeError exception. Otherwise, set the text track cue size to the new value.");
    82                 testException("textCue.size = -200", "DOMException.INDEX_SIZE_ERR");
    83                 testException("textCue.size = 110", "DOMException.INDEX_SIZE_ERR");
     82                testDOMException("textCue.size = -200", "DOMException.INDEX_SIZE_ERR");
     83                testDOMException("textCue.size = 110", "DOMException.INDEX_SIZE_ERR");
    8484                run("textCue.size = 57");
    8585                testExpected("textCue.size", 57);
     
    8787                logSpecURL("http://www.whatwg.org/specs/web-apps/current-work/multipage/the-video-element.html#dom-texttrackcue-align",
    8888                           "On setting, the text track cue alignment must be set to the value ... is a case-sensitive match for the new value, if any. If none of the values match, then the user agent must instead throw a SyntaxError exception.");
    89                 testException("textCue.align = 'End'", "DOMException.SYNTAX_ERR");
     89                testDOMException("textCue.align = 'End'", "DOMException.SYNTAX_ERR");
    9090                testExpected("textCue.align", "middle");
    9191                run("textCue.align = 'end'");
  • trunk/LayoutTests/media/video-buffered.html

    r79630 r147969  
    44<script>
    55    testExpected("video.buffered.length", 0);
    6     testException("video.buffered.start(-1)", "DOMException.INDEX_SIZE_ERR");
    7     testException("video.buffered.end(-1)", "DOMException.INDEX_SIZE_ERR");
    8     testException("video.buffered.start(0)", "DOMException.INDEX_SIZE_ERR");
    9     testException("video.buffered.end(0)", "DOMException.INDEX_SIZE_ERR");
     6    testDOMException("video.buffered.start(-1)", "DOMException.INDEX_SIZE_ERR");
     7    testDOMException("video.buffered.end(-1)", "DOMException.INDEX_SIZE_ERR");
     8    testDOMException("video.buffered.start(0)", "DOMException.INDEX_SIZE_ERR");
     9    testDOMException("video.buffered.end(0)", "DOMException.INDEX_SIZE_ERR");
    1010    waitForEvent('canplaythrough',
    1111        function ()
     
    1414            testExpected("video.buffered.start(0)", 0);
    1515            testExpected("video.buffered.end(0)", 0, '>');
    16             testException("video.buffered.start(-1)", "DOMException.INDEX_SIZE_ERR");
    17             testException("video.buffered.end(-1)", "DOMException.INDEX_SIZE_ERR");
    18             testException("video.buffered.start(1)", "DOMException.INDEX_SIZE_ERR");
    19             testException("video.buffered.end(1)", "DOMException.INDEX_SIZE_ERR");
     16            testDOMException("video.buffered.start(-1)", "DOMException.INDEX_SIZE_ERR");
     17            testDOMException("video.buffered.end(-1)", "DOMException.INDEX_SIZE_ERR");
     18            testDOMException("video.buffered.start(1)", "DOMException.INDEX_SIZE_ERR");
     19            testDOMException("video.buffered.end(1)", "DOMException.INDEX_SIZE_ERR");
    2020            endTest();
    2121        }
  • trunk/LayoutTests/media/video-play-require-user-gesture.html

    r139016 r147969  
    5858                consoleWrite("* No user gesture initiated");
    5959                run("video.play()");
    60                 testException("video.webkitEnterFullScreen()", "DOMException.INVALID_STATE_ERR");
     60                testDOMException("video.webkitEnterFullScreen()", "DOMException.INVALID_STATE_ERR");
    6161                testExpected("video.paused", true);
    6262                consoleWrite("");
  • trunk/LayoutTests/media/video-seek-no-src-exception.html

    r79630 r147969  
    1010        testExpected("video.networkState", HTMLMediaElement.NETWORK_EMPTY);
    1111        testExpected("video.readyState", HTMLMediaElement.HAVE_NOTHING);
    12         testException("video.currentTime = 1.1", "DOMException.INVALID_STATE_ERR");
     12        testDOMException("video.currentTime = 1.1", "DOMException.INVALID_STATE_ERR");
    1313        setTimeout(endTest, 200)
    1414    </script>
  • trunk/LayoutTests/media/video-seekable.html

    r79630 r147969  
    44<script>
    55    testExpected("video.seekable.length", 0);
    6     testException("video.seekable.start(-1)", "DOMException.INDEX_SIZE_ERR");
    7     testException("video.seekable.end(-1)", "DOMException.INDEX_SIZE_ERR");
    8     testException("video.seekable.start(0)", "DOMException.INDEX_SIZE_ERR");
    9     testException("video.seekable.end(0)", "DOMException.INDEX_SIZE_ERR");
     6    testDOMException("video.seekable.start(-1)", "DOMException.INDEX_SIZE_ERR");
     7    testDOMException("video.seekable.end(-1)", "DOMException.INDEX_SIZE_ERR");
     8    testDOMException("video.seekable.start(0)", "DOMException.INDEX_SIZE_ERR");
     9    testDOMException("video.seekable.end(0)", "DOMException.INDEX_SIZE_ERR");
    1010    waitForEvent('canplaythrough',
    1111        function ()
     
    1414            testExpected("video.seekable.start(0)", 0);
    1515            testExpected("video.seekable.end(0)",  0, ">");
    16             testException("video.seekable.start(-1)", "DOMException.INDEX_SIZE_ERR");
    17             testException("video.seekable.end(-1)", "DOMException.INDEX_SIZE_ERR");
    18             testException("video.seekable.start(1)", "DOMException.INDEX_SIZE_ERR");
    19             testException("video.seekable.end(1)", "DOMException.INDEX_SIZE_ERR");
     16            testDOMException("video.seekable.start(-1)", "DOMException.INDEX_SIZE_ERR");
     17            testDOMException("video.seekable.end(-1)", "DOMException.INDEX_SIZE_ERR");
     18            testDOMException("video.seekable.start(1)", "DOMException.INDEX_SIZE_ERR");
     19            testDOMException("video.seekable.end(1)", "DOMException.INDEX_SIZE_ERR");
    2020            endTest();
    2121        }
  • trunk/LayoutTests/media/video-test.js

    r134440 r147969  
    203203}
    204204
    205 function testException(testString, exceptionString)
     205function testDOMException(testString, exceptionString)
    206206{
    207207    try {
    208208        eval(testString);
    209209    } catch (ex) {
    210         logResult(ex.code == eval(exceptionString), "TEST(" + testString + ") THROWS("+exceptionString+")");
    211     }
     210        var exception = ex;
     211    }
     212    logResult(exception instanceof DOMException && exception.code === eval(exceptionString),
     213        "TEST(" + testString + ") THROWS(" + exceptionString + ")");
     214}
     215
     216function testException(testString, exceptionString) {
     217    try {
     218        eval(testString);
     219    } catch (ex) {
     220        var exception = ex;
     221    }
     222    logResult(exception !== undefined && exception == eval(exceptionString),
     223        "TEST(" + testString + ") THROWS(" + exceptionString + ")");
    212224}
    213225
  • trunk/LayoutTests/media/video-volume.html

    r79630 r147969  
    99    run("video.volume = 0");
    1010    testExpected("video.volume", 0);
    11     testException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
    12     testException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
     11    testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
     12    testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
    1313    video.src = findMediaFile("video", "content/test");
    1414    run("video.load()");
     
    1717        run("video.volume = 0.5");
    1818        testExpected("video.volume", 0.5);
    19         testException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
    20         testException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
     19        testDOMException("video.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
     20        testDOMException("video.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
    2121        endTest();
    2222    });
Note: See TracChangeset for help on using the changeset viewer.