dom/indexedDB/test/unit/test_invalid_version.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial