diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /dom/indexedDB/test/extensions | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'dom/indexedDB/test/extensions')
-rw-r--r-- | dom/indexedDB/test/extensions/bootstrap.js | 84 | ||||
-rw-r--r-- | dom/indexedDB/test/extensions/indexedDB-test@mozilla.org.xpi | bin | 0 -> 5605 bytes | |||
-rw-r--r-- | dom/indexedDB/test/extensions/install.rdf | 31 | ||||
-rw-r--r-- | dom/indexedDB/test/extensions/moz.build | 16 |
4 files changed, 131 insertions, 0 deletions
diff --git a/dom/indexedDB/test/extensions/bootstrap.js b/dom/indexedDB/test/extensions/bootstrap.js new file mode 100644 index 000000000..357ac462e --- /dev/null +++ b/dom/indexedDB/test/extensions/bootstrap.js @@ -0,0 +1,84 @@ +/** + * Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/publicdomain/zero/1.0/ + */ + +var Ci = Components.interfaces; +var Cu = Components.utils; + +Cu.import("resource://gre/modules/Services.jsm"); +Cu.import("resource://gre/modules/XPCOMUtils.jsm"); + +function testForExpectedSymbols(stage, data) { + const expectedSymbols = [ "IDBKeyRange", "indexedDB" ]; + for (var symbol of expectedSymbols) { + Services.prefs.setBoolPref("indexeddbtest.bootstrap." + stage + "." + + symbol, symbol in this); + } +} + +function GlobalObjectsComponent() { + this.wrappedJSObject = this; +} + +GlobalObjectsComponent.prototype = +{ + QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports]), + + runTest: function() { + const name = "Splendid Test"; + + let ok = this.ok; + let finishTest = this.finishTest; + + let keyRange = IDBKeyRange.only(42); + ok(keyRange, "Got keyRange"); + + let request = indexedDB.open(name, 1); + request.onerror = function(event) { + ok(false, "indexedDB error, '" + event.target.error.name + "'"); + finishTest(); + } + request.onsuccess = function(event) { + let db = event.target.result; + ok(db, "Got database"); + finishTest(); + } + } +}; + +var gFactory = { + register: function() { + var registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar); + + var classID = Components.ID("{d6f85dcb-537d-447e-b783-75d4b405622d}"); + var description = "IndexedDBTest"; + var contractID = "@mozilla.org/dom/indexeddb/GlobalObjectsComponent;1"; + var factory = XPCOMUtils._getFactory(GlobalObjectsComponent); + + registrar.registerFactory(classID, description, contractID, factory); + + this.unregister = function() { + registrar.unregisterFactory(classID, factory); + delete this.unregister; + }; + } +}; + +function install(data, reason) { + testForExpectedSymbols("install"); +} + +function startup(data, reason) { + testForExpectedSymbols("startup"); + gFactory.register(); +} + +function shutdown(data, reason) { + testForExpectedSymbols("shutdown"); + gFactory.unregister(); +} + +function uninstall(data, reason) { + testForExpectedSymbols("uninstall"); +} diff --git a/dom/indexedDB/test/extensions/indexedDB-test@mozilla.org.xpi b/dom/indexedDB/test/extensions/indexedDB-test@mozilla.org.xpi Binary files differnew file mode 100644 index 000000000..bbe2430e2 --- /dev/null +++ b/dom/indexedDB/test/extensions/indexedDB-test@mozilla.org.xpi diff --git a/dom/indexedDB/test/extensions/install.rdf b/dom/indexedDB/test/extensions/install.rdf new file mode 100644 index 000000000..e7afc68d6 --- /dev/null +++ b/dom/indexedDB/test/extensions/install.rdf @@ -0,0 +1,31 @@ +<?xml version="1.0"?> + +<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:em="http://www.mozilla.org/2004/em-rdf#"> + + <Description about="urn:mozilla:install-manifest"> + <em:name>IndexedDBTest</em:name> + <em:description>IndexedDB functions for use in testing.</em:description> + <em:creator>Mozilla</em:creator> + <em:version>2016.03.09</em:version> + <em:id>indexedDB-test@mozilla.org</em:id> + <em:type>2</em:type> + <em:bootstrap>true</em:bootstrap> + <em:targetApplication> + <Description> + <!-- Firefox --> + <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> + <em:minVersion>45.0</em:minVersion> + <em:maxVersion>*</em:maxVersion> + </Description> + </em:targetApplication> + <em:targetApplication> + <Description> + <!-- Fennec --> + <em:id>{aa3c5121-dab2-40e2-81ca-7ea25febc110}</em:id> + <em:minVersion>45.0</em:minVersion> + <em:maxVersion>*</em:maxVersion> + </Description> + </em:targetApplication> + </Description> +</RDF> diff --git a/dom/indexedDB/test/extensions/moz.build b/dom/indexedDB/test/extensions/moz.build new file mode 100644 index 000000000..a810e8a9e --- /dev/null +++ b/dom/indexedDB/test/extensions/moz.build @@ -0,0 +1,16 @@ +# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*- +# vim: set filetype=python: +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +XPI_NAME = 'indexedDB' + +FINAL_TARGET_FILES += [ + 'bootstrap.js', + 'install.rdf', +] + +TEST_HARNESS_FILES.testing.mochitest.extensions += [ + 'indexedDB-test@mozilla.org.xpi', +] |