Backed out changeset cbce223800c1 (bug 1540247) for xpcshell failures at test_obsoleteOrigins.js on a CLOSED TREE.
authorGurzau Raul <rgurzau@mozilla.com>
Wed, 28 Aug 2019 19:47:27 +0300
changeset 554186 67bb50bd8b67089c001ade51d157ad8e085f3e6c
parent 554185 f977db21c7ca393ceb48e71680d57dc6c0703c1d
child 554187 3fa90607a8acbdd55cd1b7ab79611d7c8963100f
push id2165
push userffxbld-merge
push dateMon, 14 Oct 2019 16:30:58 +0000
treeherdermozilla-release@0eae18af659f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1540247
milestone70.0a1
backs outcbce223800c16c143e396a4f7cc82e57784fbc81
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 cbce223800c1 (bug 1540247) for xpcshell failures at test_obsoleteOrigins.js on a CLOSED TREE.
dom/quota/QuotaManagerService.cpp
dom/quota/nsIQuotaManagerService.idl
dom/quota/test/unit/head.js
dom/quota/test/unit/test_isValidMozURL.js
dom/quota/test/unit/test_obsoleteOrigins.js
dom/quota/test/unit/xpcshell.ini
--- a/dom/quota/QuotaManagerService.cpp
+++ b/dom/quota/QuotaManagerService.cpp
@@ -12,17 +12,16 @@
 #include "mozilla/Hal.h"
 #include "mozilla/Preferences.h"
 #include "mozilla/StaticPrefs_dom.h"
 #include "mozilla/Unused.h"
 #include "mozilla/ipc/BackgroundChild.h"
 #include "mozilla/ipc/BackgroundParent.h"
 #include "mozilla/ipc/BackgroundUtils.h"
 #include "mozilla/ipc/PBackgroundChild.h"
-#include "mozilla/net/MozURL.h"
 #include "nsIIdleService.h"
 #include "nsIObserverService.h"
 #include "nsIScriptSecurityManager.h"
 #include "nsXULAppAPI.h"
 #include "QuotaManager.h"
 #include "QuotaRequests.h"
 
 #define PROFILE_BEFORE_CHANGE_QM_OBSERVER_ID "profile-before-change-qm"
@@ -785,34 +784,16 @@ QuotaManagerService::ListInitializedOrig
     return rv;
   }
 
   request.forget(_retval);
   return NS_OK;
 }
 
 NS_IMETHODIMP
-QuotaManagerService::IsValidMozURL(const nsACString& aSpec,
-                                   bool* const _retval) {
-  // it should also be okay to call it on the worker thread, but there is no any
-  // request for that so far
-  MOZ_ASSERT(NS_IsMainThread());
-  MOZ_ASSERT(_retval);
-
-  RefPtr<net::MozURL> url;
-  const bool valid =
-      NS_SUCCEEDED(net::MozURL::Init(getter_AddRefs(url), aSpec));
-  MOZ_ASSERT(valid == static_cast<bool>(url));
-
-  *_retval = valid;
-
-  return NS_OK;
-}
-
-NS_IMETHODIMP
 QuotaManagerService::Observe(nsISupports* aSubject, const char* aTopic,
                              const char16_t* aData) {
   MOZ_ASSERT(XRE_IsParentProcess());
   MOZ_ASSERT(NS_IsMainThread());
 
   if (!strcmp(aTopic, PROFILE_BEFORE_CHANGE_QM_OBSERVER_ID)) {
     RemoveIdleObserver();
     return NS_OK;
--- a/dom/quota/nsIQuotaManagerService.idl
+++ b/dom/quota/nsIQuotaManagerService.idl
@@ -220,25 +220,16 @@ interface nsIQuotaManagerService : nsISu
    *
    * @param aPrincipal
    *        A principal for the origin which we want to persist.
    */
   [must_use] nsIQuotaRequest
   persist(in nsIPrincipal aPrincipal);
 
   /**
-   * Check if given spec is a valid MozURL.
-   *
-   * @param aSpec
-   *        A URL spec to check.
-   */
-  [must_use] boolean
-  isValidMozURL(in ACString aSpec);
-
-  /**
    * Given an origin, asynchronously calculate its group quota usage and quota
    * limit. An origin's group is the set of all origins that share the same
    * eTLD+1. This method is intended to be used for our implementation of the
    * StorageManager.estimate() method. When we fix bug 1305665 and stop tracking
    * quota limits on a group basis, this method will switch to operating on
    * origins. Callers should strongly consider whether they want to be using
    * getUsageForPrincipal() instead.
    *
--- a/dom/quota/test/unit/head.js
+++ b/dom/quota/test/unit/head.js
@@ -207,20 +207,16 @@ function listInitializedOrigins(callback
   let request = SpecialPowers._getQuotaManager().listInitializedOrigins(
     callback
   );
   request.callback = callback;
 
   return request;
 }
 
-function isValidMozURL(spec) {
-  return SpecialPowers._getQuotaManager().isValidMozURL(spec);
-}
-
 function installPackage(packageName) {
   let directoryService = Cc["@mozilla.org/file/directory_service;1"].getService(
     Ci.nsIProperties
   );
 
   let currentDir = directoryService.get("CurWorkD", Ci.nsIFile);
 
   let packageFile = currentDir.clone();
deleted file mode 100644
--- a/dom/quota/test/unit/test_isValidMozURL.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// For comprehensive test cases of MozURL::Init, refer to
-// netwerk/test/gtest/TestMozURL.cpp, this is just testing whether the
-// validation result is correctly exposed to JS.
-//
-// This test doesn't have to be an async function because there are no async
-// operations inside the test. However, it's currently needed due to our
-// infrastructure for xpcshell tests.
-async function testSteps() {
-  // TODO add more appropriate test cases?
-  const validURLs = ["about:blank", "https://foo.github.io"];
-  const invalidURLs = ["", "xxx"];
-
-  info("Testing valid URLs");
-
-  for (let validURL of validURLs) {
-    ok(isValidMozURL(validURL), "Should be considered valid: " + validURL);
-  }
-
-  for (let invalidURL of invalidURLs) {
-    ok(
-      !isValidMozURL(invalidURL),
-      "Should be considered invalid: " + invalidURL
-    );
-  }
-}
--- a/dom/quota/test/unit/test_obsoleteOrigins.js
+++ b/dom/quota/test/unit/test_obsoleteOrigins.js
@@ -4,32 +4,31 @@
  */
 
 // This test is mainly to verify the 2_1To2_2 upgrade does remove obsolete
 // origins and the temporary storage initialization won't be blocked after
 // removing them. Also, an invalid origin shouldn't block upgrades, so this
 // test verifies that as well.
 
 async function testSteps() {
-  const obsoleteOriginPaths =
-    [
-      "storage/default/chrome+++content+browser.xul/",
-      "storage/default/moz-safe-about+++home/",
-      // Deprecated client
-      "storage/default/https+++example.com/asmjs/",
-      "storage/default/about+home+1",
-      "storage/default/about+home+1+q",
-      // about:reader?url=xxx before bug 1422456
-      "storage/default/about+reader+url=https%3A%2F%2Fexample.com",
-    ] +
-    // XXX The below directory is expected to fail now, but
-    // we expect it to pass once the rust-url issue is fixed.
-    isValidMozURL("https://smaug----.github.io")
-      ? ["storage/default/https+++smaug----.github.io/"]
-      : [];
+  const obsoleteOriginPaths = [
+    "storage/default/chrome+++content+browser.xul/",
+    "storage/default/moz-safe-about+++home/",
+    // XXX Bug 1540247 will expose MozURL::Init to js so that we could test the
+    // failure cases of that. The below directory is expected to fail now, but
+    // we expect it to pass once the rust-url issue is fixed. Thus, only test it
+    // manually.
+    // "storage/default/https+++smaug----.github.io/",
+    // Deprecated client
+    "storage/default/https+++example.com/asmjs/",
+    "storage/default/about+home+1",
+    "storage/default/about+home+1+q",
+    // about:reader?url=xxx before bug 1422456
+    "storage/default/about+reader+url=https%3A%2F%2Fexample.com",
+  ];
   const obsoleteFilePath =
     "storage/default/https+++example.com/idb/UUID123.tmp";
   const invalidOriginPath = "storage/default/invalid+++example.com/";
 
   info(
     "Verifying the obsolete origins are removed after the 2_1To2_2 upgrade" +
       " and invalid origins wouldn't block upgrades"
   );
--- a/dom/quota/test/unit/xpcshell.ini
+++ b/dom/quota/test/unit/xpcshell.ini
@@ -33,17 +33,16 @@ support-files =
 [test_caching_groupMismatch.js]
 [test_createLocalStorage.js]
 [test_clearStorageForPrincipal.js]
 [test_defaultStorageUpgrade.js]
 [test_getUsage.js]
 [test_groupMismatch.js]
 [test_idbSubdirUpgrade.js]
 [test_initTemporaryStorage.js]
-[test_isValidMozURL.js]
 [test_listInitializedOrigins.js]
 [test_localStorageArchive1upgrade.js]
 [test_localStorageArchive4upgrade.js]
 [test_localStorageArchiveDowngrade.js]
 [test_morgueCleanup.js]
 [test_obsoleteOriginAttributesUpgrade.js]
 [test_obsoleteOrigins.js]
 [test_originAttributesUpgrade.js]