OLD | NEW |
1 if (this.importScripts) { | 1 if (this.importScripts) { |
2 importScripts('../../../fast/js/resources/js-test-pre.js'); | 2 importScripts('../../../fast/js/resources/js-test-pre.js'); |
3 importScripts('shared.js'); | 3 importScripts('shared.js'); |
4 } | 4 } |
5 | 5 |
6 description("Test that bad version parameters cause TypeError"); | 6 description("Test that bad version parameters cause TypeError"); |
7 | 7 |
8 function test() | 8 function test() |
9 { | 9 { |
10 removeVendorPrefixes(); | 10 removeVendorPrefixes(); |
11 setDBNameFromPath(); | 11 setDBNameFromPath(); |
12 | 12 |
13 request = evalAndLog("indexedDB.deleteDatabase(dbname)"); | 13 request = evalAndLog("indexedDB.deleteDatabase(dbname)"); |
14 request.onsuccess = deleteSuccess; | 14 request.onsuccess = deleteSuccess; |
15 request.onerror = unexpectedErrorCallback; | 15 request.onerror = unexpectedErrorCallback; |
16 } | 16 } |
17 | 17 |
18 function deleteSuccess(evt) { | 18 function deleteSuccess(evt) { |
19 preamble(); | 19 preamble(); |
20 evalAndExpectExceptionClass("indexedDB.open(dbname, 'stringversion')", "Type
Error"); | 20 evalAndExpectExceptionClass("indexedDB.open(dbname, 'stringversion')", "Type
Error"); |
21 evalAndExpectExceptionClass("indexedDB.open(dbname, 0)", "TypeError"); | 21 evalAndExpectExceptionClass("indexedDB.open(dbname, 0)", "TypeError"); |
22 evalAndExpectExceptionClass("indexedDB.open(dbname, -5)", "TypeError"); | 22 evalAndExpectExceptionClass("indexedDB.open(dbname, -5)", "TypeError"); |
23 debug(""); | 23 evalAndExpectExceptionClass("indexedDB.open(dbname, -1)", "TypeError"); |
24 debug("FIXME: Using -1 doesn't throw TypeError but it should"); | 24 evalAndExpectExceptionClass("indexedDB.open(dbname, 0x20000000000000)", "Typ
eError"); |
25 evalAndExpectExceptionClass("request = indexedDB.open(dbname, -1)", "TypeErr
or"); | 25 finishJSTest(); |
26 request.onsuccess = unexpectedSuccessCallback; | |
27 request.onerror = unexpectedErrorCallback; | |
28 request.onblocked = unexpectedBlockedCallback; | |
29 request.onupgradeneeded = unexpectedUpgradeNeededCallback; | |
30 } | 26 } |
31 | 27 |
32 test(); | 28 test(); |
OLD | NEW |