Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 2e75b66

Browse files
Bug 1620998 - Fix XPCShell tests that need to run the crash helper r=afranchuk,geckoview-reviewers,application-update-reviewers,nalexander,owlish
Differential Revision: https://phabricator.services.mozilla.com/D231525
1 parent 5b7df65 commit 2e75b66

File tree

7 files changed

+22
-10
lines changed

7 files changed

+22
-10
lines changed

mobile/shared/modules/geckoview/test/xpcshell/test_ChildCrashHandler.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ const { makeFakeAppDir } = ChromeUtils.importESModule(
1414

1515
add_setup(async function () {
1616
await makeFakeAppDir();
17-
// The test harness sets MOZ_CRASHREPORTER_NO_REPORT, which disables crash
18-
// reports. This test needs them enabled.
17+
// The test harness sets MOZ_CRASHREPORTER_NO_REPORT, which disables
18+
// reporting crashes to the user. This test needs them enabled.
1919
const noReport = Services.env.get("MOZ_CRASHREPORTER_NO_REPORT");
2020
Services.env.set("MOZ_CRASHREPORTER_NO_REPORT", "");
2121

netwerk/test/unit/test_socks.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,19 @@ function runScriptSubprocess(script, args) {
4343

4444
var file = do_get_file(script);
4545
var proc = new Process(bin);
46-
var procArgs = [file.path].concat(args);
46+
var procArgs = [];
47+
48+
if (AppConstants.platform != "macosx") {
49+
var grebind = ds.get("GreBinD", Ci.nsIFile);
50+
if (!grebind.exists()) {
51+
do_throw("Could not find binary dir");
52+
}
53+
54+
procArgs.push("-g", grebind.path);
55+
}
56+
57+
procArgs.push(file.path);
58+
procArgs = procArgs.concat(args);
4759

4860
proc.run(false, procArgs, procArgs.length);
4961

testing/mozbase/mozcrash/mozcrash/mozcrash.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ def cleanup_pending_crash_reports():
818818
)
819819
elif mozinfo.isMac:
820820
location = os.path.expanduser(
821-
"~/Library/Application Support/firefox/Crash Reports"
821+
"~/Library/Application Support/Firefox/Crash Reports"
822822
)
823823
else:
824824
location = os.path.expanduser("~/.mozilla/firefox/Crash Reports")

testing/xpcshell/runxpcshelltests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,7 @@ def run_test(self):
975975
return_code_ok
976976
and self.usingCrashReporter
977977
and not self.saw_crash_reporter_init
978+
and len(process_output) > 0
978979
)
979980

980981
passed = (

testing/xpcshell/selftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
import os
1313
import pprint
1414
import re
15-
import shutil
1615
import sys
1716
import tempfile
1817
import unittest
1918

19+
import mozfile
2020
import mozinfo
2121
import six
2222
from mozlog import structured
@@ -485,7 +485,7 @@ def setUp(self):
485485
self.x.harness_timeout = 30 if not mozinfo.info["ccov"] else 60
486486

487487
def tearDown(self):
488-
shutil.rmtree(self.tempdir)
488+
mozfile.remove(self.tempdir)
489489
self.x.shutdownNode()
490490

491491
def writeFile(self, name, contents, mode="w"):

toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
* "Couldn't get the user appdata directory. Crash events may not be produced."
88
* in nsExceptionHandler.cpp (possibly bug 619104)
99
*
10-
* Test log warnings that happen after the test has finished
11-
* "OOPDeinit() without successful OOPInit()" in nsExceptionHandler.cpp
12-
* (bug 619104)
1310
* "XPCOM objects created/destroyed from static ctor/dtor" in nsTraceRefcnt.cpp
1411
* (possibly bug 457479)
1512
*

toolkit/xre/test/test_install_hash.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,18 @@ const XRE = Cc["@mozilla.org/xre/directory-provider;1"].getService(
1515
);
1616
const HASH = XRE.getInstallHash(false);
1717
const EXE = Services.dirsvc.get("XREExeF", Ci.nsIFile);
18+
const GREBIND = Services.dirsvc.get("GreBinD", Ci.nsIFile);
1819
const SCRIPT = do_get_file("show_hash.js", false);
1920

2021
async function getHash(bin) {
2122
try {
2223
// If this test is running through firefox.exe -xpcshell, we need
2324
// to make sure to execute the script through it as well.
2425
let args = [];
25-
if (!bin.leafName.startsWith("xpcshell")) {
26+
if (!bin.leafName.toLowerCase().startsWith("xpcshell")) {
2627
args.push("-xpcshell");
2728
}
29+
args.push("-g", GREBIND.path);
2830
args.push(SCRIPT.path);
2931

3032
let proc = await Subprocess.call({

0 commit comments

Comments
 (0)