1 if (this.importScripts) {
2 importScripts('../../../resources/js-test.js');
3 importScripts('shared.js');
6 description("Test IndexedDB's basics.");
10 request = evalAndLog("indexedDB.open('basics')");
11 shouldBeTrue("'result' in request");
12 evalAndExpectException("request.result", "DOMException.INVALID_STATE_ERR", "'InvalidStateError'");
13 shouldBeTrue("'error' in request");
14 evalAndExpectException("request.error", "DOMException.INVALID_STATE_ERR", "'InvalidStateError'");
15 shouldBeTrue("'source' in request");
16 shouldBeNull("request.source");
17 shouldBeTrue("'transaction' in request");
18 shouldBeNull("request.transaction");
19 shouldBeTrue("'readyState' in request");
20 shouldBeEqualToString("request.readyState", "pending");
21 shouldBeTrue("'onsuccess' in request");
22 shouldBeNull("request.onsuccess");
23 shouldBeTrue("'onerror' in request");
24 shouldBeNull("request.onerror");
25 request.onsuccess = openCallback;
26 request.onerror = unexpectedErrorCallback;
29 function openCallback(evt)
32 shouldBeTrue("'result' in event.target");
33 shouldBeTrue("!!event.target.result");
34 shouldBeTrue("'error' in event.target");
35 shouldBeNull("event.target.error");
36 shouldBeTrue("'source' in event.target");
37 shouldBeNull("request.source");
38 shouldBeTrue("'transaction' in event.target");
39 shouldBeNull("event.target.transaction");
40 shouldBeTrue("'readyState' in request");
41 shouldBeEqualToString("event.target.readyState", "done");
42 shouldBeTrue("'onsuccess' in event.target");
43 shouldBeTrue("'onerror' in event.target");