1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/indexedDB/test/unit/GlobalObjectsModule.jsm Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,36 @@ 1.4 +/** 1.5 + * Any copyright is dedicated to the Public Domain. 1.6 + * http://creativecommons.org/publicdomain/zero/1.0/ 1.7 + */ 1.8 + 1.9 +Components.utils.importGlobalProperties(["indexedDB"]); 1.10 + 1.11 +this.EXPORTED_SYMBOLS = [ 1.12 + "GlobalObjectsModule" 1.13 +]; 1.14 + 1.15 +this.GlobalObjectsModule = function GlobalObjectsModule() { 1.16 +} 1.17 + 1.18 +GlobalObjectsModule.prototype = { 1.19 + runTest: function() { 1.20 + const name = "Splendid Test"; 1.21 + 1.22 + let ok = this.ok; 1.23 + let finishTest = this.finishTest; 1.24 + 1.25 + let keyRange = IDBKeyRange.only(42); 1.26 + ok(keyRange, "Got keyRange"); 1.27 + 1.28 + let request = indexedDB.open(name, 1); 1.29 + request.onerror = function(event) { 1.30 + ok(false, "indexedDB error, '" + event.target.error.name + "'"); 1.31 + finishTest(); 1.32 + } 1.33 + request.onsuccess = function(event) { 1.34 + let db = event.target.result; 1.35 + ok(db, "Got database"); 1.36 + finishTest(); 1.37 + } 1.38 + } 1.39 +}