Skip to content

Commit

Permalink
Backed out 6 changesets (bug 1464542) for xpcshell failures on test_S…
Browse files Browse the repository at this point in the history
…ervices.js. CLOSED TREE

Backed out changeset b50af9005851 (bug 1464542)
Backed out changeset 9d3a0ea2cf65 (bug 1464542)
Backed out changeset 71c3475fcbc2 (bug 1464542)
Backed out changeset 51ff93220a95 (bug 1464542)
Backed out changeset e84de1547c09 (bug 1464542)
Backed out changeset bbecc16d08eb (bug 1464542)
  • Loading branch information
ncsoregi committed Jul 9, 2020
1 parent 595a699 commit b355fcc
Show file tree
Hide file tree
Showing 82 changed files with 340 additions and 643 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,18 @@
const { UrlClassifierTestUtils } = ChromeUtils.import(
"resource://testing-common/UrlClassifierTestUtils.jsm"
);
Services.cookies.QueryInterface(Ci.nsICookieService);
XPCOMUtils.defineLazyServiceGetter(
Services,
"cookies",
"@mozilla.org/cookieService;1",
"nsICookieService"
);
XPCOMUtils.defineLazyServiceGetter(
Services,
"cookiemgr",
"@mozilla.org/cookiemanager;1",
"nsICookieManager"
);

function restore_prefs() {
Services.prefs.clearUserPref("network.cookie.cookieBehavior");
Expand Down Expand Up @@ -70,12 +81,12 @@ async function test_cookie_settings({
expectedThirdPartyCookies = 0;
}
is(
Services.cookies.countCookiesFromHost(firstPartyURI.host),
Services.cookiemgr.countCookiesFromHost(firstPartyURI.host),
expectedFirstPartyCookies,
"Number of first-party cookies should match expected"
);
is(
Services.cookies.countCookiesFromHost(thirdPartyURI.host),
Services.cookiemgr.countCookiesFromHost(thirdPartyURI.host),
expectedThirdPartyCookies,
"Number of third-party cookies should match expected"
);
Expand Down
2 changes: 1 addition & 1 deletion browser/components/extensions/parent/ext-browsingData.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ const clearLocalStorage = async function(options) {
Services.obs.notifyObservers(null, "extension:purge-localStorage");
}

if (Services.domStorageManager.nextGenLocalStorageEnabled) {
if (Services.lsm.nextGenLocalStorageEnabled) {
// Ideally we could reuse the logic in Sanitizer.jsm or nsIClearDataService,
// but this API exposes an ability to wipe data at a much finger granularity
// than those APIs. So custom logic is used here to wipe only the QM
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ add_task(async function testLocalStorage() {
await browser.tabs.sendMessage(tabs[0].id, "checkLocalStorageCleared");
await browser.tabs.sendMessage(tabs[1].id, "checkLocalStorageSet");

if (
SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled ===
false
) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled === false) {
// This assertion fails when localStorage is using the legacy
// implementation (See Bug 1595431).
browser.test.log("Skipped assertion on nextGenLocalStorageEnabled=false");
Expand Down
3 changes: 3 additions & 0 deletions browser/installer/package-manifest.in
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@

; JavaScript components
@RESPATH@/browser/components/BrowserComponents.manifest
@RESPATH@/components/EnterprisePolicies.js
@RESPATH@/components/EnterprisePoliciesContent.js
@RESPATH@/components/EnterprisePolicies.manifest
@RESPATH@/components/toolkitsearch.manifest
@RESPATH@/components/extensions.manifest
#ifdef MOZ_UPDATER
Expand Down
17 changes: 5 additions & 12 deletions config/makefiles/xpidl/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ idl_deps_dir := .deps
dist_idl_dir := $(DIST)/idl
dist_include_dir := $(DIST)/include
dist_xpcrs_dir := $(DIST)/xpcrs
stub_file := xptdata.stub
process_py := $(topsrcdir)/python/mozbuild/mozbuild/action/xpidl-process.py
target_file := $(topobjdir)/xpcom/reflect/xptinfo/xptdata.cpp
xptdata_h := $(dist_include_dir)/xptdata.h
generated_files := $(target_file) $(xptdata_h)
generated_file := $(topobjdir)/xpcom/reflect/xptinfo/xptdata.cpp
code_gen_py := $(topsrcdir)/xpcom/reflect/xptinfo/xptcodegen.py
code_gen_deps := $(topsrcdir)/xpcom/ds/tools/perfecthash.py

Expand Down Expand Up @@ -62,21 +59,17 @@ xpt_files := $(addsuffix .xpt,$(xpidl_modules))

depends_files := $(foreach root,$(xpidl_modules),$(idl_deps_dir)/$(root).pp)

GARBAGE += $(stub_file) $(xpt_files) $(depends_files) $(target_file)
GARBAGE += $(xpt_files) $(depends_files) $(generated_file)

ifdef COMPILE_ENVIRONMENT
xpidl:: $(generated_files)
xpidl:: $(generated_file)
endif

# See bug 1420119 for why we need the semicolon.
$(target_file) $(xptdata_h) : $(stub_file) ;

$(xpt_files): $(process_py) $(call mkdir_deps,$(idl_deps_dir) $(dist_include_dir) $(dist_xpcrs_dir))

$(stub_file) : $(xpt_files) $(code_gen_py) $(code_gen_deps)
$(generated_file): $(xpt_files) $(code_gen_py) $(code_gen_deps)
$(REPORT_BUILD)
$(PYTHON3) $(code_gen_py) $(generated_files) $(xpt_files)
@touch $@
$(PYTHON3) $(code_gen_py) $(generated_file) $(xpt_files)

-include $(depends_files)

Expand Down
2 changes: 0 additions & 2 deletions docshell/build/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ Classes = [
},
{
'name': 'URIFixup',
'js_name': 'uriFixup',
'cid': '{c6cf88b7-452e-47eb-bdc9-86e3561648ef}',
'contract_ids': ['@mozilla.org/docshell/uri-fixup;1'],
'interfaces': ['nsIURIFixup'],
'jsm': 'resource://gre/modules/URIFixup.jsm',
'constructor': 'URIFixup',
},
Expand Down
2 changes: 0 additions & 2 deletions dom/base/components.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@

Classes = [
{
'js_name': 'droppedLinkHandler',
'cid': '{1f34bc80-1bc7-11d6-a384-d705dd0746fc}',
'contract_ids': ['@mozilla.org/content/dropped-link-handler;1'],
'interfaces': ['nsIDroppedLinkHandler'],
'jsm': 'resource://gre/modules/ContentAreaDropListener.jsm',
'constructor': 'ContentAreaDropListener',
},
Expand Down
19 changes: 0 additions & 19 deletions dom/base/nsJSUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,25 +327,6 @@ inline void AssignJSLinearString(nsAString& dest, JSLinearString* s) {
js::CopyLinearStringChars(dest.BeginWriting(), s, len);
}

inline void AssignJSLinearString(nsACString& dest, JSLinearString* s) {
size_t len = js::GetLinearStringLength(s);
static_assert(js::MaxStringLength < (1 << 30),
"Shouldn't overflow here or in SetCapacity");
dest.SetLength(len);
js::CopyLinearStringChars(dest.BeginWriting(), s, len);
}

template <typename T>
class nsTAutoJSLinearString : public nsTAutoString<T> {
public:
explicit nsTAutoJSLinearString(JSLinearString* str) {
AssignJSLinearString(*this, str);
}
};

using nsAutoJSLinearString = nsTAutoJSLinearString<char16_t>;
using nsAutoJSLinearCString = nsTAutoJSLinearString<char>;

template <typename T>
class nsTAutoJSString : public nsTAutoString<T> {
public:
Expand Down
2 changes: 1 addition & 1 deletion dom/bindings/test/TestInterfaceJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ TestInterfaceJS.prototype = {
testThrowNsresultFromNative(x) {
// We want to throw an exception that we generate from an nsresult thrown
// by a C++ component.
Services.io.notImplemented();
Services.netUtils.notImplemented();
},

testThrowCallbackError(callback) {
Expand Down
2 changes: 1 addition & 1 deletion dom/localstorage/test/unit/test_preloading.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function testSteps() {
];

async function isPreloaded(principal) {
return Services.domStorageManager.isPreloaded(principal);
return Services.lsm.isPreloaded(principal);
}

info("Setting prefs");
Expand Down
6 changes: 5 additions & 1 deletion dom/manifest/ImageObjectProcessor.jsm
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,11 @@ ImageObjectProcessor.prototype.process = function(
};
let value = extractor.extractValue(spec);
if (value) {
value = Services.io.parseRequestContentType(value, charset, hadCharset);
value = Services.netUtils.parseRequestContentType(
value,
charset,
hadCharset
);
}
return value || undefined;
}
Expand Down
10 changes: 5 additions & 5 deletions dom/tests/browser/browser_localStorage_e10s.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Services.scriptloader.loadSubScript(
/* import-globals-from helper_localStorage_e10s.js */

function waitForLocalStorageFlush() {
if (Services.domStorageManager.nextGenLocalStorageEnabled) {
if (Services.lsm.nextGenLocalStorageEnabled) {
return new Promise(resolve => executeSoon(resolve));
}

Expand All @@ -45,7 +45,7 @@ function waitForLocalStorageFlush() {
* notifications, but correctness is guaranteed after the second notification.
*/
function triggerAndWaitForLocalStorageFlush() {
if (Services.domStorageManager.nextGenLocalStorageEnabled) {
if (Services.lsm.nextGenLocalStorageEnabled) {
return new Promise(resolve => executeSoon(resolve));
}

Expand Down Expand Up @@ -76,7 +76,7 @@ function clearOriginStorageEnsuringNoPreload() {
HELPER_PAGE_ORIGIN
);

if (Services.domStorageManager.nextGenLocalStorageEnabled) {
if (Services.lsm.nextGenLocalStorageEnabled) {
let request = Services.qms.clearStoragesForPrincipal(
principal,
"default",
Expand Down Expand Up @@ -114,8 +114,8 @@ async function verifyTabPreload(knownTab, expectStorageExists) {
let principal = Services.scriptSecurityManager.createContentPrincipalFromOrigin(
origin
);
if (Services.domStorageManager.nextGenLocalStorageEnabled) {
return Services.domStorageManager.isPreloaded(principal);
if (Services.lsm.nextGenLocalStorageEnabled) {
return Services.lsm.isPreloaded(principal);
}
return !!Services.domStorageManager.getStorage(
null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ requestLongerTimeout(4);
* Verify snapshotting of our localStorage implementation in multi-e10s setup.
*/
add_task(async function() {
if (!Services.domStorageManager.nextGenLocalStorageEnabled) {
if (!Services.lsm.nextGenLocalStorageEnabled) {
ok(true, "Test ignored when the next gen local storage is not enabled.");
return;
}
Expand Down
10 changes: 5 additions & 5 deletions dom/tests/mochitest/localstorage/localStorageCommon.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function localStorageFlush(cb) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(function() {
cb();
});
Expand All @@ -17,7 +17,7 @@ function localStorageFlush(cb) {
}

function localStorageReload(callback) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
localStorage.close();
let qms = SpecialPowers.Services.qms;
let principal = SpecialPowers.wrap(document).nodePrincipal;
Expand All @@ -36,7 +36,7 @@ function localStorageReload(callback) {
}

function localStorageFlushAndReload(callback) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
localStorage.close();
let qms = SpecialPowers.Services.qms;
let principal = SpecialPowers.wrap(document).nodePrincipal;
Expand All @@ -54,7 +54,7 @@ function localStorageFlushAndReload(callback) {
}

function localStorageClearAll(callback) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
let qms = SpecialPowers.Services.qms;
let ssm = SpecialPowers.Services.scriptSecurityManager;

Expand Down Expand Up @@ -92,7 +92,7 @@ function localStorageClearAll(callback) {
}

function localStorageClearDomain(domain, callback) {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
let qms = SpecialPowers.Services.qms;
let principal = SpecialPowers.wrap(document).nodePrincipal;
let request = qms.clearStoragesForPrincipal(principal, "default", "ls");
Expand Down
2 changes: 1 addition & 1 deletion dom/tests/mochitest/localstorage/test_bug600307-DBOps.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
localStorageReload(function() {
is(localStorage.length, 0, "localStorage clean in case 4");

if (!SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled &&
if (!SpecialPowers.Services.lsm.nextGenLocalStorageEnabled &&
SpecialPowers.Cc["@mozilla.org/xre/app-info;1"].getService(
SpecialPowers.Ci.nsIXULRuntime).processType != SpecialPowers.Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
// Following tests cannot be run in a child/plugin process type
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

function startTest()
{
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
ok(true, "Test ignored when the next gen local storage is enabled.");
SimpleTest.finish();
return;
Expand Down
10 changes: 5 additions & 5 deletions dom/tests/mochitest/localstorage/test_localStorageQuota.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
switch (currentTest)
{
case 1:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "http://example.com";
Expand Down Expand Up @@ -50,7 +50,7 @@
// Try to set a new 500 bytes key and check we fail because we are over the
// quota.
case 5:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "https://test2.example.com";
Expand All @@ -67,7 +67,7 @@

// Now try again to set 500 bytes key, it must succeed.
case 7:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "https://test2.example.com";
Expand All @@ -76,7 +76,7 @@
break;

case 8:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(doNextTest);
} else {
// Do a clean up...
Expand All @@ -92,7 +92,7 @@
break;

case 10:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(doNextTest);
} else {
// Do a clean up...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
// Initialy setup the quota to testing value of 1024B and
// set a 500 bytes key with name length 1 (allocate 501 bytes)
case 1:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "http://example.com";
Expand Down Expand Up @@ -74,7 +74,7 @@
// Try to set a new 500 bytes key and check we fail because we are over the
// quota.
case 5:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "https://test2.example.com";
Expand All @@ -91,7 +91,7 @@

// Now try again to set 500 bytes key, it must succeed.
case 7:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
slaveOrigin = "http://test1.example.com";
} else {
slaveOrigin = "https://test2.example.com";
Expand All @@ -100,7 +100,7 @@
break;

case 8:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(() => doNextTest(aWindow));
} else {
// Do a clean up...
Expand All @@ -116,7 +116,7 @@
break;

case 10:
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
SimpleTest.executeSoon(() => doNextTest(aWindow));
} else {
// Do a clean up...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
SimpleTest.waitForExplicitFinish();

function startTest() {
if (SpecialPowers.Services.domStorageManager.nextGenLocalStorageEnabled) {
if (SpecialPowers.Services.lsm.nextGenLocalStorageEnabled) {
ok(true, "Test ignored when the next gen local storage is enabled.");
SimpleTest.finish();
return;
Expand Down
Loading

0 comments on commit b355fcc

Please sign in to comment.