Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / storage / indexeddb / resources / intversion-bad-parameters.js
blob3853fc3cabdc7017c1e40957e2725addf26903e3
1 if (this.importScripts) {
2     importScripts('../../../resources/js-test.js');
3     importScripts('shared.js');
6 description("Test that bad version parameters cause TypeError");
8 function test()
10     setDBNameFromPath();
12     request = evalAndLog("indexedDB.deleteDatabase(dbname)");
13     request.onsuccess = deleteSuccess;
14     request.onerror = unexpectedErrorCallback;
17 function deleteSuccess(evt) {
18     preamble();
19     evalAndExpectExceptionClass("indexedDB.open(dbname, 'stringversion')", "TypeError");
20     evalAndExpectExceptionClass("indexedDB.open(dbname, 0)", "TypeError");
21     evalAndExpectExceptionClass("indexedDB.open(dbname, -5)", "TypeError");
22     evalAndExpectExceptionClass("indexedDB.open(dbname, Infinity)", "TypeError");
23     evalAndExpectExceptionClass("indexedDB.open(dbname, -Infinity)", "TypeError");
24     evalAndExpectExceptionClass("indexedDB.open(dbname, NaN)", "TypeError");
25     evalAndExpectExceptionClass("indexedDB.open(dbname, -1)", "TypeError");
26     evalAndExpectExceptionClass("indexedDB.open(dbname, 0x20000000000000)", "TypeError");
27     evalAndExpectExceptionClass("indexedDB.open(dbname, null)", "TypeError");
28     evalAndExpectExceptionClass("indexedDB.open(dbname, undefined)", "TypeError");
29     finishJSTest();
32 test();