1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Test IndexedDB invalid keys");
8 indexedDBTest(prepareDatabase);
9 function prepareDatabase()
11 db = event.target.result;
12 event.target.transaction.onabort = unexpectedAbortCallback;
13 objectStore = evalAndLog("db.createObjectStore('foo');");
17 function testInvalidKeys()
20 "void 0", // Undefined
22 "(function() { return arguments; }())", // Arguments
26 "function () {}", // Function
29 "NaN", // Number (special case)
30 "new Date(NaN)", // Date (special case)
34 "self.document", // HTMLDocument
35 "self.document.body" // HTMLBodyElement
38 invalidKeys.forEach(function(key) {
39 evalAndExpectException("request = objectStore.put('value', " + key + ")", "0", "'DataError'");