Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 }