michael@0: /** michael@0: * Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: var testGenerator = testSteps(); michael@0: michael@0: function testSteps() michael@0: { michael@0: const name = this.window ? window.location.pathname : "Splendid Test"; michael@0: michael@0: try { michael@0: indexedDB.open(name, 0); michael@0: ok(false, "Should have thrown!"); michael@0: } michael@0: catch (e) { michael@0: ok(e instanceof TypeError, "Got TypeError."); michael@0: is(e.name, "TypeError", "Good error name."); michael@0: } michael@0: michael@0: try { michael@0: indexedDB.open(name, -1); michael@0: ok(false, "Should have thrown!"); michael@0: } michael@0: catch (e) { michael@0: ok(e instanceof TypeError, "Got TypeError."); michael@0: is(e.name, "TypeError", "Good error name."); michael@0: } michael@0: michael@0: try { michael@0: indexedDB.open(name, { version: 0 }); michael@0: ok(false, "Should have thrown!"); michael@0: } michael@0: catch (e) { michael@0: ok(e instanceof TypeError, "Got TypeError."); michael@0: is(e.name, "TypeError", "Good error name."); michael@0: } michael@0: michael@0: try { michael@0: indexedDB.open(name, { version: -1 }); michael@0: ok(false, "Should have thrown!"); michael@0: } michael@0: catch (e) { michael@0: ok(e instanceof TypeError, "Got TypeError."); michael@0: is(e.name, "TypeError", "Good error name."); michael@0: } michael@0: michael@0: finishTest(); michael@0: yield undefined; michael@0: }