Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | /** |
michael@0 | 2 | * Any copyright is dedicated to the Public Domain. |
michael@0 | 3 | * http://creativecommons.org/publicdomain/zero/1.0/ |
michael@0 | 4 | */ |
michael@0 | 5 | |
michael@0 | 6 | Components.utils.importGlobalProperties(["indexedDB"]); |
michael@0 | 7 | |
michael@0 | 8 | this.EXPORTED_SYMBOLS = [ |
michael@0 | 9 | "GlobalObjectsModule" |
michael@0 | 10 | ]; |
michael@0 | 11 | |
michael@0 | 12 | this.GlobalObjectsModule = function GlobalObjectsModule() { |
michael@0 | 13 | } |
michael@0 | 14 | |
michael@0 | 15 | GlobalObjectsModule.prototype = { |
michael@0 | 16 | runTest: function() { |
michael@0 | 17 | const name = "Splendid Test"; |
michael@0 | 18 | |
michael@0 | 19 | let ok = this.ok; |
michael@0 | 20 | let finishTest = this.finishTest; |
michael@0 | 21 | |
michael@0 | 22 | let keyRange = IDBKeyRange.only(42); |
michael@0 | 23 | ok(keyRange, "Got keyRange"); |
michael@0 | 24 | |
michael@0 | 25 | let request = indexedDB.open(name, 1); |
michael@0 | 26 | request.onerror = function(event) { |
michael@0 | 27 | ok(false, "indexedDB error, '" + event.target.error.name + "'"); |
michael@0 | 28 | finishTest(); |
michael@0 | 29 | } |
michael@0 | 30 | request.onsuccess = function(event) { |
michael@0 | 31 | let db = event.target.result; |
michael@0 | 32 | ok(db, "Got database"); |
michael@0 | 33 | finishTest(); |
michael@0 | 34 | } |
michael@0 | 35 | } |
michael@0 | 36 | } |