|
1 /** |
|
2 * Any copyright is dedicated to the Public Domain. |
|
3 * http://creativecommons.org/publicdomain/zero/1.0/ |
|
4 */ |
|
5 |
|
6 function ok(cond, msg) { |
|
7 dump("ok(" + cond + ", \"" + msg + "\")"); |
|
8 do_check_true(!!cond, Components.stack.caller); |
|
9 } |
|
10 |
|
11 function finishTest() |
|
12 { |
|
13 do_execute_soon(function() { |
|
14 do_test_finished(); |
|
15 }); |
|
16 } |
|
17 |
|
18 function run_test() { |
|
19 const name = "Splendid Test"; |
|
20 |
|
21 Cu.importGlobalProperties(["indexedDB"]); |
|
22 |
|
23 do_test_pending(); |
|
24 |
|
25 let keyRange = IDBKeyRange.only(42); |
|
26 ok(keyRange, "Got keyRange"); |
|
27 |
|
28 let request = indexedDB.open(name, 1); |
|
29 request.onerror = function(event) { |
|
30 ok(false, "indexedDB error, '" + event.target.error.name + "'"); |
|
31 finishTest(); |
|
32 } |
|
33 request.onsuccess = function(event) { |
|
34 let db = event.target.result; |
|
35 ok(db, "Got database"); |
|
36 finishTest(); |
|
37 } |
|
38 } |