Bug 1406181 - Test storage.local from extension tab pages on file and indexedDB backends. r=aswan
authorLuca Greco <lgreco@mozilla.com>
Thu, 19 Oct 2017 16:27:02 +0200
changeset 421619 de1544d92b89fdf13f89d28cb9c8b6b4b2bfbd90
parent 421618 73030596b51f12ed24a5c3482ce3722923635cbc
child 421620 e42b6189ab12097554c2b247193797384371e58c
push id34099
push userncsoregi@mozilla.com
push dateWed, 06 Jun 2018 22:00:08 +0000
treeherdermozilla-central@1ab062fd31db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaswan
bugs1406181
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1406181 - Test storage.local from extension tab pages on file and indexedDB backends. r=aswan MozReview-Commit-ID: BYhlnLiitgh
toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
--- a/toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_storage_tab.js
@@ -1,11 +1,13 @@
 "use strict";
 
-add_task(async function test_multiple_pages() {
+ChromeUtils.import("resource://gre/modules/ExtensionStorageIDB.jsm");
+
+async function test_multiple_pages() {
   let extension = ExtensionTestUtils.loadExtension({
     async background() {
       function awaitMessage(expectedMsg, api = "test") {
         return new Promise(resolve => {
           browser[api].onMessage.addListener(function listener(msg) {
             if (msg === expectedMsg) {
               browser[api].onMessage.removeListener(listener);
               resolve();
@@ -82,9 +84,19 @@ add_task(async function test_multiple_pa
   extension.onMessage("remove-page", async url => {
     await contentPage.close();
     extension.sendMessage("page-removed");
   });
 
   await extension.startup();
   await extension.awaitFinish("storage-multiple");
   await extension.unload();
+}
+
+add_task(async function test_storage_local_file_backend_from_tab() {
+  return runWithPrefs([[ExtensionStorageIDB.BACKEND_ENABLED_PREF, false]],
+                      test_multiple_pages);
 });
+
+add_task(async function test_storage_local_idb_backend_from_tab() {
+  return runWithPrefs([[ExtensionStorageIDB.BACKEND_ENABLED_PREF, true]],
+                      test_multiple_pages);
+});