test_invalid_version.js (726B)
1 /** 2 * Any copyright is dedicated to the Public Domain. 3 * http://creativecommons.org/publicdomain/zero/1.0/ 4 */ 5 6 /* exported testGenerator */ 7 var testGenerator = testSteps(); 8 9 // eslint-disable-next-line require-yield 10 function* testSteps() { 11 const name = this.window ? window.location.pathname : "Splendid Test"; 12 13 try { 14 indexedDB.open(name, 0); 15 ok(false, "Should have thrown!"); 16 } catch (e) { 17 ok(e instanceof TypeError, "Got TypeError."); 18 is(e.name, "TypeError", "Good error name."); 19 } 20 21 try { 22 indexedDB.open(name, -1); 23 ok(false, "Should have thrown!"); 24 } catch (e) { 25 ok(e instanceof TypeError, "Got TypeError."); 26 is(e.name, "TypeError", "Good error name."); 27 } 28 29 finishTest(); 30 }