dom/indexedDB/test/unit/test_invalid_version.js

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

     1 /**
     2  * Any copyright is dedicated to the Public Domain.
     3  * http://creativecommons.org/publicdomain/zero/1.0/
     4  */
     6 var testGenerator = testSteps();
     8 function testSteps()
     9 {
    10   const name = this.window ? window.location.pathname : "Splendid Test";
    12   try {
    13     indexedDB.open(name, 0);
    14     ok(false, "Should have thrown!");
    15   }
    16   catch (e) {
    17     ok(e instanceof TypeError, "Got TypeError.");
    18     is(e.name, "TypeError", "Good error name.");
    19   }
    21   try {
    22     indexedDB.open(name, -1);
    23     ok(false, "Should have thrown!");
    24   }
    25   catch (e) {
    26     ok(e instanceof TypeError, "Got TypeError.");
    27     is(e.name, "TypeError", "Good error name.");
    28   }
    30   try {
    31     indexedDB.open(name, { version: 0 });
    32     ok(false, "Should have thrown!");
    33   }
    34   catch (e) {
    35     ok(e instanceof TypeError, "Got TypeError.");
    36     is(e.name, "TypeError", "Good error name.");
    37   }
    39   try {
    40     indexedDB.open(name, { version: -1 });
    41     ok(false, "Should have thrown!");
    42   }
    43   catch (e) {
    44     ok(e instanceof TypeError, "Got TypeError.");
    45     is(e.name, "TypeError", "Good error name.");
    46   }
    48   finishTest();
    49   yield undefined;
    50 }

mercurial