Backed out changeset 9fb6d1811696 (bug 942639) for B2G mochitest-3 timeouts.
authorRyan VanderMeulen <ryanvm@gmail.com>
Thu, 05 Dec 2013 11:36:01 -0500
changeset 174623 e805a81f0a1c88dbc61082a155d91b90d277c9d5
parent 174622 d648a922f82b0e70e74dfaaca3e068c30c88def2
child 174624 71e8967053dce4ef32e1b8a326db89e2b262958a
push id445
push userffxbld
push dateMon, 10 Mar 2014 22:05:19 +0000
treeherdermozilla-release@dc38b741b04e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs942639
milestone28.0a1
backs out9fb6d18116967ac51c8cc943a63fadf7a7d990de
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
Backed out changeset 9fb6d1811696 (bug 942639) for B2G mochitest-3 timeouts.
content/base/public/nsIMessageManager.idl
content/base/src/nsFrameMessageManager.cpp
dom/apps/src/Webapps.jsm
dom/base/Navigator.cpp
dom/base/Navigator.h
dom/datastore/DataStoreChangeNotifier.jsm
dom/datastore/DataStoreService.js
dom/datastore/DataStoreServiceInternal.jsm
dom/datastore/tests/file_certifiedApp.html
dom/datastore/tests/mochitest.ini
dom/datastore/tests/test_app_install.html
dom/datastore/tests/test_arrays.html
dom/datastore/tests/test_basic.html
dom/datastore/tests/test_bug924104.html
dom/datastore/tests/test_certifiedApp.html
dom/datastore/tests/test_changes.html
dom/datastore/tests/test_oop.html
dom/datastore/tests/test_readonly.html
dom/datastore/tests/test_sync.html
dom/ipc/AppProcessChecker.cpp
dom/ipc/AppProcessChecker.h
dom/webidl/Navigator.webidl
--- a/content/base/public/nsIMessageManager.idl
+++ b/content/base/public/nsIMessageManager.idl
@@ -378,22 +378,22 @@ interface nsIFrameScriptLoader : nsISupp
 
   /**
    * Returns a list of all delayed scripts that will be loaded once
    * a (remote) frame becomes available.
    */
   nsIDOMDOMStringList getDelayedFrameScripts();
 };
 
-[scriptable, builtinclass, uuid(ad57800b-ff21-4e2f-91d3-e68615ae8afe)]
+[scriptable, builtinclass, uuid(b37821ff-df79-44d4-821c-6d6ec4dfe1e9)]
 interface nsIProcessChecker : nsISupports
 {
 
   /**
-   * Return true if the "remote" process has |aPermission|.  This is
+   * Return true iff the "remote" process has |aPermission|.  This is
    * intended to be used by JS implementations of cross-process DOM
    * APIs, like so
    *
    *   recvFooRequest: function(message) {
    *     if (!message.target.assertPermission("foo")) {
    *       return false;
    *     }
    *     // service foo request
@@ -404,17 +404,17 @@ interface nsIProcessChecker : nsISupport
    * though it doesn't hurt anything either.
    *
    * Note: If the remote content process does *not* have |aPermission|,
    * it will be killed as a precaution.
    */
   boolean assertPermission(in DOMString aPermission);
 
   /**
-   * Return true if the "remote" process has |aManifestURL|.  This is
+   * Return true iff the "remote" process has |aManifestURL|.  This is
    * intended to be used by JS implementations of cross-process DOM
    * APIs, like so
    *
    *   recvFooRequest: function(message) {
    *     if (!message.target.assertContainApp("foo")) {
    *       return false;
    *     }
    *     // service foo request
@@ -427,22 +427,19 @@ interface nsIProcessChecker : nsISupport
    * Note: If the remote content process does *not* contain |aManifestURL|,
    * it will be killed as a precaution.
    */
   boolean assertContainApp(in DOMString aManifestURL);
 
   boolean assertAppHasPermission(in DOMString aPermission);
 
   /**
-   * Return true if the "remote" process' principal has an appStatus equal to
+   * Return true iff the "remote" process' principal has an appStatus equal to
    * |aStatus|.
    *
    * This interface only returns meaningful data when our content is
    * in a separate process.  If it shares the same OS process as us,
    * then applying this permission check doesn't add any security,
    * though it doesn't hurt anything either.
-   *
-   * Note: If the remote content process does *not* has the |aStatus|,
-   * it will be killed as a precaution.
    */
-  boolean assertAppHasStatus(in unsigned short aStatus);
+  boolean checkAppHasStatus(in unsigned short aStatus);
 
 };
--- a/content/base/src/nsFrameMessageManager.cpp
+++ b/content/base/src/nsFrameMessageManager.cpp
@@ -800,18 +800,18 @@ nsFrameMessageManager::AssertAppHasPermi
                                               bool* aHasPermission)
 {
   return AssertProcessInternal(ASSERT_APP_HAS_PERMISSION,
                                aPermission,
                                aHasPermission);
 }
 
 NS_IMETHODIMP
-nsFrameMessageManager::AssertAppHasStatus(unsigned short aStatus,
-                                          bool* aHasStatus)
+nsFrameMessageManager::CheckAppHasStatus(unsigned short aStatus,
+                                         bool* aHasStatus)
 {
   *aHasStatus = false;
 
   // This API is only supported for message senders in the chrome process.
   if (!mChrome || mIsBroadcaster) {
     return NS_ERROR_NOT_IMPLEMENTED;
   }
   if (!mCallback) {
@@ -1587,22 +1587,16 @@ public:
     return true;
   }
 
   bool CheckAppHasPermission(const nsAString& aPermission)
   {
     // In a single-process scenario, the child always has all capabilities.
     return true;
   }
-
-  virtual bool CheckAppHasStatus(unsigned short aStatus)
-  {
-    // In a single-process scenario, the child always has all capabilities.
-    return true;
-  }
 };
 
 
 /**
  * Send messages to the parent process.
  */
 class ChildProcessMessageManagerCallback : public MessageManagerCallback
 {
--- a/dom/apps/src/Webapps.jsm
+++ b/dom/apps/src/Webapps.jsm
@@ -308,19 +308,20 @@ this.DOMApplicationRegistry = {
 
   updateDataStoreForApp: function(aId) {
     if (!this.webapps[aId]) {
       return;
     }
 
     // Create or Update the DataStore for this app
     this._readManifests([{ id: aId }], (function(aResult) {
-      let app = this.webapps[aId];
-      this.updateDataStore(app.localId, app.origin, app.manifestURL,
-                           aResult[0].manifest, app.appStatus);
+      this.updateDataStore(this.webapps[aId].localId,
+                           this.webapps[aId].origin,
+                           this.webapps[aId].manifestURL,
+                           aResult[0].manifest);
     }).bind(this));
   },
 
   updatePermissionsForApp: function updatePermissionsForApp(aId) {
     if (!this.webapps[aId]) {
       return;
     }
 
@@ -582,25 +583,17 @@ this.DOMApplicationRegistry = {
       else
         onAppsLoaded();
 #else
       onAppsLoaded();
 #endif
     }).bind(this));
   },
 
-  updateDataStore: function(aId, aOrigin, aManifestURL, aManifest, aAppStatus) {
-    // Just Certified Apps can use DataStores
-    let prefName = "dom.testing.datastore_enabled_for_hosted_apps";
-    if (aAppStatus != Ci.nsIPrincipal.APP_STATUS_CERTIFIED &&
-        (Services.prefs.getPrefType(prefName) == Services.prefs.PREF_INVALID ||
-         !Services.prefs.getBoolPref(prefName))) {
-      return;
-    }
-
+  updateDataStore: function(aId, aOrigin, aManifestURL, aManifest) {
     if ('datastores-owned' in aManifest) {
       for (let name in aManifest['datastores-owned']) {
         let readonly = "access" in aManifest['datastores-owned'][name]
                          ? aManifest['datastores-owned'][name].access == 'readonly'
                          : false;
 
         dataStoreService.installDataStore(aId, name, aOrigin, aManifestURL,
                                           readonly);
@@ -1479,17 +1472,17 @@ this.DOMApplicationRegistry = {
           if (supportUseCurrentProfile()) {
             PermissionsInstaller.installPermissions(
               { manifest: aData,
                 origin: app.origin,
                 manifestURL: app.manifestURL },
               true);
           }
           this.updateDataStore(this.webapps[id].localId, app.origin,
-                               app.manifestURL, aData, app.appStatus);
+                               app.manifestURL, aData);
           this.broadcastMessage("Webapps:UpdateState", {
             app: app,
             manifest: aData,
             manifestURL: app.manifestURL
           });
           this.broadcastMessage("Webapps:FireEvent", {
             eventType: "downloadapplied",
             manifestURL: app.manifestURL
@@ -1653,17 +1646,17 @@ this.DOMApplicationRegistry = {
           PermissionsInstaller.installPermissions({
             manifest: app.manifest,
             origin: app.origin,
             manifestURL: aData.manifestURL
           }, true);
         }
 
         this.updateDataStore(this.webapps[id].localId, app.origin,
-                             app.manifestURL, app.manifest, app.appStatus);
+                             app.manifestURL, app.manifest);
 
         app.name = manifest.name;
         app.csp = manifest.csp || "";
         app.role = manifest.role || "";
         app.updateTime = Date.now();
       } else {
         manifest = new ManifestHelper(aOldManifest, app.origin);
       }
@@ -2289,18 +2282,17 @@ onInstallSuccessAck: function onInstallS
             manifest: jsonManifest
           },
           isReinstall,
           this.uninstall.bind(this, aData, aData.mm)
         );
       }
 
       this.updateDataStore(this.webapps[id].localId,  this.webapps[id].origin,
-                           this.webapps[id].manifestURL, jsonManifest,
-                           this.webapps[id].appStatus);
+                           this.webapps[id].manifestURL, jsonManifest);
     }
 
     for each (let prop in ["installState", "downloadAvailable", "downloading",
                            "downloadSize", "readyToApplyDownload"]) {
       aData.app[prop] = appObject[prop];
     }
 
     if (manifest.appcache_path) {
@@ -2401,17 +2393,17 @@ onInstallSuccessAck: function onInstallS
         PermissionsInstaller.installPermissions({
           manifest: aManifest,
           origin: aNewApp.origin,
           manifestURL: aNewApp.manifestURL
         }, true);
       }
 
       this.updateDataStore(this.webapps[aId].localId, aNewApp.origin,
-                           aNewApp.manifestURL, aManifest, aNewApp.appStatus);
+                           aNewApp.manifestURL, aManifest);
 
       this.broadcastMessage("Webapps:UpdateState", {
         app: app,
         manifest: aManifest,
         manifestURL: aNewApp.manifestURL
       });
       this.broadcastMessage("Webapps:FireEvent", {
         eventType: ["downloadsuccess", "downloadapplied"],
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -45,18 +45,16 @@
 #endif
 #include "nsIIdleObserver.h"
 #include "nsIPermissionManager.h"
 #include "nsNetUtil.h"
 #include "nsIHttpChannel.h"
 #include "TimeManager.h"
 #include "DeviceStorage.h"
 #include "nsIDOMNavigatorSystemMessages.h"
-#include "nsIAppsService.h"
-#include "mozIApplication.h"
 
 #ifdef MOZ_MEDIA_NAVIGATOR
 #include "MediaManager.h"
 #endif
 #ifdef MOZ_B2G_BT
 #include "BluetoothManager.h"
 #endif
 #include "DOMCameraManager.h"
@@ -1847,48 +1845,16 @@ bool Navigator::HasInputMethodSupport(JS
 {
   nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);
   return Preferences::GetBool("dom.mozInputMethod.testing", false) ||
          (Preferences::GetBool("dom.mozInputMethod.enabled", false) &&
           win && CheckPermission(win, "input"));
 }
 
 /* static */
-bool
-Navigator::HasDataStoreSupport(JSContext* /* unused */, JSObject* aGlobal)
-{
-  // First of all, the general pref has to be turned on.
-  bool enabled = false;
-  Preferences::GetBool("dom.datastore.enabled", &enabled);
-  NS_ENSURE_TRUE(enabled, false);
-
-  // Just for testing, we can enable DataStore for any kind of app.
-  if (Preferences::GetBool("dom.testing.datastore_enabled_for_hosted_apps", false)) {
-    return true;
-  }
-
-  nsCOMPtr<nsPIDOMWindow> win = GetWindowFromGlobal(aGlobal);
-  if (!win) {
-    return false;
-  }
-
-  nsIDocument* doc = win->GetExtantDoc();
-  if (!doc || !doc->NodePrincipal()) {
-    return false;
-  }
-
-  uint16_t status;
-  if (NS_FAILED(doc->NodePrincipal()->GetAppStatus(&status))) {
-    return false;
-  }
-
-  return status == nsIPrincipal::APP_STATUS_CERTIFIED;
-}
-
-/* static */
 already_AddRefed<nsPIDOMWindow>
 Navigator::GetWindowFromGlobal(JSObject* aGlobal)
 {
   nsCOMPtr<nsPIDOMWindow> win =
     do_QueryInterface(nsJSUtils::GetStaticScriptGlobal(aGlobal));
   MOZ_ASSERT(!win || win->IsInnerWindow());
   return win.forget();
 }
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -281,18 +281,16 @@ public:
                                   JSObject* /* unused */);
 #endif // MOZ_MEDIA_NAVIGATOR
 
   static bool HasPushNotificationsSupport(JSContext* /* unused */,
                                           JSObject* aGlobal);
 
   static bool HasInputMethodSupport(JSContext* /* unused */, JSObject* aGlobal);
 
-  static bool HasDataStoreSupport(JSContext* /* unused */, JSObject* aGlobal);
-
   nsPIDOMWindow* GetParentObject() const
   {
     return GetWindow();
   }
 
   virtual JSObject* WrapObject(JSContext* cx,
                                JS::Handle<JSObject*> scope) MOZ_OVERRIDE;
 
--- a/dom/datastore/DataStoreChangeNotifier.jsm
+++ b/dom/datastore/DataStoreChangeNotifier.jsm
@@ -63,23 +63,16 @@ this.DataStoreChangeNotifier = {
         obj.mm.sendAsyncMessage(aMsgName, aData.message);
       }
     });
   },
 
   receiveMessage: function(aMessage) {
     debug("receiveMessage");
 
-    let prefName = 'dom.testing.datastore_enabled_for_hosted_apps';
-    if ((Services.prefs.getPrefType(prefName) == Services.prefs.PREF_INVALID ||
-         !Services.prefs.getBoolPref(prefName)) &&
-        !aMessage.target.assertAppHasStatus(Ci.nsIPrincipal.APP_STATUS_CERTIFIED)) {
-      return;
-    }
-
     switch (aMessage.name) {
       case "DataStore:Changed":
         this.broadcastMessage("DataStore:Changed:Return:OK", aMessage.data);
         break;
 
       case "DataStore:RegisterForMessages":
         debug("Register!");
 
--- a/dom/datastore/DataStoreService.js
+++ b/dom/datastore/DataStoreService.js
@@ -226,20 +226,16 @@ DataStoreService.prototype = {
     debug('getDataStores - aName: ' + aName);
 
     let self = this;
     return new aWindow.Promise(function(resolve, reject) {
       // If this request comes from the main process, we have access to the
       // window, so we can skip the ipc communication.
       if (self.inParent) {
         let stores = self.getDataStoresInfo(aName, aWindow.document.nodePrincipal.appId);
-        if (stores === null) {
-          reject(new aWindow.DOMError("SecurityError", "Access denied"));
-          return;
-        }
         self.getDataStoreCreate(aWindow, resolve, stores);
       } else {
         // This method can be called in the child so we need to send a request
         // to the parent and create DataStore object here.
         new DataStoreServiceChild(aWindow, aName, function(aStores) {
           debug("DataStoreServiceChild success callback!");
           self.getDataStoreCreate(aWindow, resolve, aStores);
         }, function() {
@@ -248,30 +244,16 @@ DataStoreService.prototype = {
         });
       }
     });
   },
 
   getDataStoresInfo: function(aName, aAppId) {
     debug('GetDataStoresInfo');
 
-    let appsService = Cc["@mozilla.org/AppsService;1"]
-                        .getService(Ci.nsIAppsService);
-    let app = appsService.getAppByLocalId(aAppId);
-    if (!app) {
-      return null;
-    }
-
-    let prefName = "dom.testing.datastore_enabled_for_hosted_apps";
-    if (app.appStatus != Ci.nsIPrincipal.APP_STATUS_CERTIFIED &&
-        (Services.prefs.getPrefType(prefName) == Services.prefs.PREF_INVALID ||
-          !Services.prefs.getBoolPref(prefName))) {
-      return null;
-    }
-
     let results = [];
 
     if (aName in this.stores) {
       if (aAppId in this.stores[aName]) {
         results.push({ name: aName,
                        owner: this.stores[aName][aAppId].owner,
                        readOnly: false,
                        enabled: this.stores[aName][aAppId].enabled });
--- a/dom/datastore/DataStoreServiceInternal.jsm
+++ b/dom/datastore/DataStoreServiceInternal.jsm
@@ -8,17 +8,16 @@ const {classes: Cc, interfaces: Ci, util
 
 this.EXPORTED_SYMBOLS = ["DataStoreServiceInternal"];
 
 function debug(s) {
   // dump('DEBUG DataStoreServiceInternal: ' + s + '\n');
 }
 
 Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
 
 XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
                                    "@mozilla.org/parentprocessmessagemanager;1",
                                    "nsIMessageBroadcaster");
 
 XPCOMUtils.defineLazyServiceGetter(this, "dataStoreService",
                                    "@mozilla.org/datastore-service;1",
                                    "nsIDataStoreService");
@@ -36,33 +35,22 @@ this.DataStoreServiceInternal = {
 
   receiveMessage: function(aMessage) {
     debug("receiveMessage");
 
     if (aMessage.name != 'DataStore:Get') {
       return;
     }
 
-    let prefName = 'dom.testing.datastore_enabled_for_hosted_apps';
-    if ((Services.prefs.getPrefType(prefName) == Services.prefs.PREF_INVALID ||
-         !Services.prefs.getBoolPref(prefName)) &&
-        !aMessage.target.assertAppHasStatus(Ci.nsIPrincipal.APP_STATUS_CERTIFIED)) {
-      return;
-    }
-
     let msg = aMessage.data;
 
     if (!aMessage.principal ||
         aMessage.principal.appId == Ci.nsIScriptSecurityManager.UNKNOWN_APP_ID) {
       aMessage.target.sendAsyncMessage("DataStore:Get:Return:KO");
       return;
     }
 
     msg.stores = dataStoreService.getDataStoresInfo(msg.name, aMessage.principal.appId);
-    if (msg.stores === null) {
-      aMessage.target.sendAsyncMessage("DataStore:Get:Return:KO");
-      return;
-    }
     aMessage.target.sendAsyncMessage("DataStore:Get:Return:OK", msg);
   }
 }
 
 DataStoreServiceInternal.init();
deleted file mode 100644
--- a/dom/datastore/tests/file_certifiedApp.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Test for DataStore just for certified Apps</title>
-</head>
-<body>
-<div id="container"></div>
-  <script type="application/javascript;version=1.7">
-
-  function ok(a, msg) {
-    alert((a ? 'OK' : 'KO')+ ' ' + msg)
-  }
-
-  function finish() {
-    alert('DONE');
-  }
-
-  ok(!("getDataStores" in navigator), "DataStore not available");
-  finish();
-  </script>
-</body>
-</html>
--- a/dom/datastore/tests/mochitest.ini
+++ b/dom/datastore/tests/mochitest.ini
@@ -6,19 +6,17 @@ support-files =
   file_changes.html
   file_changes2.html
   file_app.sjs
   file_app.template.webapp
   file_app2.template.webapp
   file_arrays.html
   file_sync.html
   file_bug924104.html
-  file_certifiedApp.html
 
 [test_app_install.html]
 [test_readonly.html]
 [test_basic.html]
 [test_changes.html]
 [test_arrays.html]
 [test_oop.html]
 [test_sync.html]
 [test_bug924104.html]
-[test_certifiedApp.html]
--- a/dom/datastore/tests/test_app_install.html
+++ b/dom/datastore/tests/test_app_install.html
@@ -22,34 +22,38 @@
 
   SpecialPowers.pushPermissions(
     [{ "type": "browser", "allow": 1, "context": document },
      { "type": "embed-apps", "allow": 1, "context": document },
      { "type": "webapps-manage", "allow": 1, "context": document }],
     function() {
       SpecialPowers.pushPrefEnv({"set": [["dom.datastore.enabled", true],
                                          ["dom.promise.enabled", true],
-                                         ["dom.testing.ignore_ipc_principal", true],
-                                         ["dom.testing.datastore_enabled_for_hosted_apps", true]]}, function() {
+                                         ["dom.testing.ignore_ipc_principal", true]]}, function() {
         gGenerator.next(); });
     });
 
   function continueTest() {
     try { gGenerator.next(); }
     catch(e) { dump("Got exception: " + e + "\n"); }
   }
 
   function cbError() {
     ok(false, "Error callback invoked");
     finish();
   }
 
   function runTest() {
     ok("getDataStores" in navigator, "getDataStores exists");
     is(typeof navigator.getDataStores, "function", "getDataStores exists and it's a function");
+    navigator.getDataStores('foo').then(function(stores) {
+      is(stores.length, 0, "getDataStores('foo') returns 0 elements");
+      continueTest();
+    }, cbError);
+    yield undefined;
 
     SpecialPowers.setAllAppsLaunchable(true);
     SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
 
     SpecialPowers.autoConfirmAppInstall(continueTest);
     yield undefined;
 
     var request = navigator.mozApps.install(gHostedManifestURL);
--- a/dom/datastore/tests/test_arrays.html
+++ b/dom/datastore/tests/test_arrays.html
@@ -73,18 +73,17 @@
          { "type": "embed-apps", "allow": 1, "context": document },
          { "type": "webapps-manage", "allow": 1, "context": document }], runTest);
     },
 
     // Preferences
     function() {
       SpecialPowers.pushPrefEnv({"set": [["dom.promise.enabled", true],
                                          ["dom.datastore.enabled", true],
-                                         ["dom.testing.ignore_ipc_principal", true],
-                                         ["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
+                                         ["dom.testing.ignore_ipc_principal", true]]}, runTest);
     },
 
     function() {
       SpecialPowers.setAllAppsLaunchable(true);
       SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
       runTest();
     },
 
--- a/dom/datastore/tests/test_basic.html
+++ b/dom/datastore/tests/test_basic.html
@@ -73,18 +73,17 @@
          { "type": "embed-apps", "allow": 1, "context": document },
          { "type": "webapps-manage", "allow": 1, "context": document }], runTest);
     },
 
     // Preferences
     function() {
       SpecialPowers.pushPrefEnv({"set": [["dom.promise.enabled", true],
                                          ["dom.datastore.enabled", true],
-                                         ["dom.testing.ignore_ipc_principal", true],
-                                         ["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
+                                         ["dom.testing.ignore_ipc_principal", true]]}, runTest);
     },
 
     function() {
       SpecialPowers.setAllAppsLaunchable(true);
       SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
       runTest();
     },
 
--- a/dom/datastore/tests/test_bug924104.html
+++ b/dom/datastore/tests/test_bug924104.html
@@ -73,18 +73,17 @@
          { "type": "embed-apps", "allow": 1, "context": document },
          { "type": "webapps-manage", "allow": 1, "context": document }], runTest);
     },
 
     // Preferences
     function() {
       SpecialPowers.pushPrefEnv({"set": [["dom.promise.enabled", true],
                                          ["dom.datastore.enabled", true],
-                                         ["dom.testing.ignore_ipc_principal", true],
-                                         ["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
+                                         ["dom.testing.ignore_ipc_principal", true]]}, runTest);
     },
 
     function() {
       SpecialPowers.setAllAppsLaunchable(true);
       SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
       runTest();
     },
 
deleted file mode 100644
--- a/dom/datastore/tests/test_certifiedApp.html
+++ /dev/null
@@ -1,132 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-  <meta charset="utf-8">
-  <title>Test DataStore for certifiedApp only</title>
-  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<div id="container"></div>
-  <script type="application/javascript;version=1.7">
-
-  var gHostedManifestURL = 'http://test/tests/dom/datastore/tests/file_app.sjs?testToken=file_certifiedApp.html';
-  var gApp;
-
-  function cbError() {
-    ok(false, "Error callback invoked");
-    finish();
-  }
-
-  function installApp() {
-    var request = navigator.mozApps.install(gHostedManifestURL);
-    request.onerror = cbError;
-    request.onsuccess = function() {
-      gApp = request.result;
-      runTest();
-    }
-  }
-
-  function uninstallApp() {
-    // Uninstall the app.
-    var request = navigator.mozApps.mgmt.uninstall(gApp);
-    request.onerror = cbError;
-    request.onsuccess = function() {
-      // All done.
-      info("All done");
-      runTest();
-    }
-  }
-
-  function testApp() {
-    var ifr = document.createElement('iframe');
-    ifr.setAttribute('mozbrowser', 'true');
-    ifr.setAttribute('mozapp', gApp.manifestURL);
-    ifr.setAttribute('src', gApp.manifest.launch_path);
-    var domParent = document.getElementById('container');
-
-    // Set us up to listen for messages from the app.
-    var listener = function(e) {
-      var message = e.detail.message;
-      if (/^OK/.exec(message)) {
-        ok(true, "Message from app: " + message);
-      } else if (/KO/.exec(message)) {
-        ok(false, "Message from app: " + message);
-      } else if (/DONE/.exec(message)) {
-        ok(true, "Messaging from app complete");
-        ifr.removeEventListener('mozbrowsershowmodalprompt', listener);
-        domParent.removeChild(ifr);
-        runTest();
-      }
-    }
-
-    // This event is triggered when the app calls "alert".
-    ifr.addEventListener('mozbrowsershowmodalprompt', listener, false);
-    domParent.appendChild(ifr);
-  }
-
-  var tests = [
-    function() {
-      ok(!("getDataStores" in navigator), "getDataStores should not exist");
-      runTest();
-    },
-
-    // Permissions
-    function() {
-      SpecialPowers.pushPermissions(
-        [{ "type": "browser", "allow": 1, "context": document },
-         { "type": "embed-apps", "allow": 1, "context": document },
-         { "type": "webapps-manage", "allow": 1, "context": document }], runTest);
-    },
-
-    // Preferences
-    function() {
-      SpecialPowers.pushPrefEnv({"set": [["dom.promise.enabled", true],
-                                         ["dom.datastore.enabled", true],
-                                         ["dom.testing.ignore_ipc_principal", true]]}, runTest);
-    },
-
-    function() {
-      SpecialPowers.setAllAppsLaunchable(true);
-      SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
-      runTest();
-    },
-
-    // No confirmation needed when an app is installed
-    function() {
-      SpecialPowers.autoConfirmAppInstall(runTest);
-    },
-
-    // Installing the app
-    installApp,
-
-    // Run tests in app
-    testApp,
-
-    // Uninstall the app
-    uninstallApp
-  ];
-
-  function runTest() {
-    if (!tests.length) {
-      finish();
-      return;
-    }
-
-    var test = tests.shift();
-    test();
-  }
-
-  function finish() {
-    SimpleTest.finish();
-  }
-
-  if (SpecialPowers.isMainProcess()) {
-    SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
-  }
-
-  SimpleTest.waitForExplicitFinish();
-  runTest();
-  </script>
-</body>
-</html>
--- a/dom/datastore/tests/test_changes.html
+++ b/dom/datastore/tests/test_changes.html
@@ -117,18 +117,17 @@
          { "type": "embed-apps", "allow": 1, "context": document },
          { "type": "webapps-manage", "allow": 1, "context": document }], runTest);
     },
 
     // Preferences
     function() {
       SpecialPowers.pushPrefEnv({"set": [["dom.promise.enabled", true],
                                          ["dom.datastore.enabled", true],
-                                         ["dom.testing.ignore_ipc_principal", true],
-                                         ["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
+                                         ["dom.testing.ignore_ipc_principal", true]]}, runTest);
     },
 
     // Enabling mozBrowser
     function() {
       SpecialPowers.setAllAppsLaunchable(true);
       SpecialPowers.pushPrefEnv({"set": [["dom.mozBrowserFramesEnabled", true]]}, runTest);
     },
 
--- a/dom/datastore/tests/test_oop.html
+++ b/dom/datastore/tests/test_oop.html
@@ -73,19 +73,21 @@
          { "type": "embed-apps", "allow": 1, "context": document },
          { "type": "webapps-manage", "allow": 1, "context": document }], runTest);
     },
 
     // Preferences
     function() {
       SpecialPowers.pushPrefEnv({"set": [["dom.promise.enabled", true],
                                          ["dom.datastore.enabled", true],
-                                         ["dom.ipc.browser_frames.oop_by_default", true],
-                                         ["dom.testing.ignore_ipc_principal", true],
-                                         ["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
+                                         ["dom.testing.ignore_ipc_principal", true]]}, runTest);
+    },
+
+    function() {
+      SpecialPowers.pushPrefEnv({"set": [["dom.ipc.browser_frames.oop_by_default", true]]}, runTest);
     },
 
     function() {
       SpecialPowers.setAllAppsLaunchable(true);
       SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
       runTest();
     },
 
--- a/dom/datastore/tests/test_readonly.html
+++ b/dom/datastore/tests/test_readonly.html
@@ -97,13 +97,12 @@
 
   if (SpecialPowers.isMainProcess()) {
     SpecialPowers.Cu.import("resource://gre/modules/DataStoreChangeNotifier.jsm");
   }
 
   SimpleTest.waitForExplicitFinish();
   SpecialPowers.pushPrefEnv({"set": [["dom.promise.enabled", true],
                                      ["dom.datastore.enabled", true],
-                                     ["dom.testing.ignore_ipc_principal", true],
-                                     ["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
+                                     ["dom.testing.ignore_ipc_principal", true]]}, runTest);
   </script>
 </body>
 </html>
--- a/dom/datastore/tests/test_sync.html
+++ b/dom/datastore/tests/test_sync.html
@@ -73,18 +73,17 @@
          { "type": "embed-apps", "allow": 1, "context": document },
          { "type": "webapps-manage", "allow": 1, "context": document }], runTest);
     },
 
     // Preferences
     function() {
       SpecialPowers.pushPrefEnv({"set": [["dom.promise.enabled", true],
                                          ["dom.datastore.enabled", true],
-                                         ["dom.testing.ignore_ipc_principal", true],
-                                         ["dom.testing.datastore_enabled_for_hosted_apps", true]]}, runTest);
+                                         ["dom.testing.ignore_ipc_principal", true]]}, runTest);
     },
 
     function() {
       SpecialPowers.setBoolPref("dom.mozBrowserFramesEnabled", true);
       runTest();
     },
 
     // No confirmation needed when an app is installed
--- a/dom/ipc/AppProcessChecker.cpp
+++ b/dom/ipc/AppProcessChecker.cpp
@@ -91,32 +91,24 @@ AssertAppStatus(PBrowserParent* aActor,
   if (!aActor) {
     NS_WARNING("Testing process capability for null actor");
     return false;
   }
 
   TabParent* tab = static_cast<TabParent*>(aActor);
   nsCOMPtr<mozIApplication> app = tab->GetOwnOrContainingApp();
 
-  bool valid = false;
-
   if (app) {
     unsigned short appStatus = 0;
     if (NS_SUCCEEDED(app->GetAppStatus(&appStatus))) {
-      valid = appStatus == aStatus;
+      return appStatus == aStatus;
     }
   }
 
-  if (!valid) {
-    printf_stderr("Security problem: Content process does not have `%d' status.  It will be killed.\n", aStatus);
-    ContentParent* process = tab->Manager();
-    process->KillHard();
-  }
-
-  return valid;
+  return false;
 }
 
 bool
 AssertAppProcess(PContentParent* aActor,
                  AssertAppProcessType aType,
                  const char* aCapability)
 {
   const InfallibleTArray<PBrowserParent*>& browsers =
--- a/dom/ipc/AppProcessChecker.h
+++ b/dom/ipc/AppProcessChecker.h
@@ -25,48 +25,39 @@ class PHalParent;
 
 enum AssertAppProcessType {
   ASSERT_APP_PROCESS_PERMISSION,
   ASSERT_APP_PROCESS_MANIFEST_URL,
   ASSERT_APP_HAS_PERMISSION
 };
 
 /**
- * Return true if the specified browser has the specified capability.
+ * Return true iff the specified browser has the specified capability.
  * If this returns false, the browser didn't have the capability and
  * will be killed.
  */
 bool
 AssertAppProcess(mozilla::dom::PBrowserParent* aActor,
                  AssertAppProcessType aType,
                  const char* aCapability);
 
-/**
- * Return true if the specified app has the specified status.
- * If this returns false, the browser will be killed.
- */
 bool
 AssertAppStatus(mozilla::dom::PBrowserParent* aActor,
                 unsigned short aStatus);
 
 /**
- * Return true if any of the PBrowsers loaded in this content process
+ * Return true iff any of the PBrowsers loaded in this content process
  * has the specified capability.  If this returns false, the process
  * didn't have the capability and will be killed.
  */
 bool
 AssertAppProcess(mozilla::dom::PContentParent* aActor,
                  AssertAppProcessType aType,
                  const char* aCapability);
 
-/**
- * Return true if any of the PBrowsers loaded in this content process
- * has an app with the specified status. If this returns false, the process
- * didn't have the status and will be killed.
- */
 bool
 AssertAppStatus(mozilla::dom::PContentParent* aActor,
                 unsigned short aStatus);
 
 bool
 AssertAppProcess(mozilla::hal_sandbox::PHalParent* aActor,
                  AssertAppProcessType aType,
                  const char* aCapability);
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -110,17 +110,17 @@ interface NavigatorBattery {
     [Throws, Func="Navigator::HasBatterySupport"]
     readonly attribute BatteryManager? battery;
 };
 Navigator implements NavigatorBattery;
 
 // https://wiki.mozilla.org/WebAPI/DataStore
 [NoInterfaceObject]
 interface NavigatorDataStore {
-    [Throws, NewObject, Func="Navigator::HasDataStoreSupport"]
+    [Throws, NewObject, Pref="dom.datastore.enabled"]
     Promise getDataStores(DOMString name);
 };
 Navigator implements NavigatorDataStore;
 
 // http://www.w3.org/TR/vibration/#vibration-interface
 partial interface Navigator {
     // We don't support sequences in unions yet
     //boolean vibrate ((unsigned long or sequence<unsigned long>) pattern);