summaryrefslogtreecommitdiffstats
path: root/testing/xpcshell
diff options
context:
space:
mode:
Diffstat (limited to 'testing/xpcshell')
-rw-r--r--testing/xpcshell/head.js6
-rw-r--r--testing/xpcshell/mach_commands.py14
-rw-r--r--testing/xpcshell/moz-http2/moz-http2.js24
-rw-r--r--testing/xpcshell/node-http2/lib/protocol/flow.js4
-rw-r--r--testing/xpcshell/remotexpcshelltests.py7
-rwxr-xr-xtesting/xpcshell/selftest.py10
6 files changed, 35 insertions, 30 deletions
diff --git a/testing/xpcshell/head.js b/testing/xpcshell/head.js
index a487c481ef..d3b19719ab 100644
--- a/testing/xpcshell/head.js
+++ b/testing/xpcshell/head.js
@@ -434,7 +434,7 @@ function _setupDevToolsServer(breakpointFiles, callback) {
// Or when devtools are destroyed and we should stop observing.
"xpcshell-test-devtools-shutdown",
];
- let observe = function (subject, topic, data) {
+ let observe = function (subject, topic) {
if (topic === "devtools-thread-ready") {
const threadActor = subject.wrappedJSObject;
threadActor.setBreakpointOnLoad(breakpointFiles);
@@ -745,7 +745,7 @@ function _execute_test() {
* @param aFiles Array of files to load.
*/
function _load_files(aFiles) {
- function load_file(element, index, array) {
+ function load_file(element) {
try {
let startTime = Cu.now();
load(element);
@@ -1829,7 +1829,7 @@ function run_next_test() {
}
function frontLoadSetups() {
- _gTests.sort(([propsA, funcA], [propsB, funcB]) => {
+ _gTests.sort(([propsA], [propsB]) => {
if (propsB.isSetup === propsA.isSetup) {
return 0;
}
diff --git a/testing/xpcshell/mach_commands.py b/testing/xpcshell/mach_commands.py
index 68f1a4504e..8c8895fcad 100644
--- a/testing/xpcshell/mach_commands.py
+++ b/testing/xpcshell/mach_commands.py
@@ -164,9 +164,7 @@ class AndroidXPCShellRunner(MozbuildObject):
if not kwargs["symbolsPath"]:
kwargs["symbolsPath"] = os.path.join(self.distdir, "crashreporter-symbols")
- if self.substs.get("MOZ_BUILD_APP") == "b2g":
- kwargs["localAPK"] = None
- elif not kwargs["localAPK"]:
+ if not kwargs["localAPK"]:
for root, _, paths in os.walk(os.path.join(kwargs["objdir"], "gradle")):
for file_name in paths:
if file_name.endswith(".apk") and file_name.startswith(
@@ -195,10 +193,7 @@ class AndroidXPCShellRunner(MozbuildObject):
def get_parser():
build_obj = MozbuildObject.from_environment(cwd=here)
- if (
- conditions.is_android(build_obj)
- or build_obj.substs.get("MOZ_BUILD_APP") == "b2g"
- ):
+ if conditions.is_android(build_obj):
return parser_remote()
else:
return parser_desktop()
@@ -245,10 +240,7 @@ def run_xpcshell_test(command_context, test_objects=None, **params):
# pylint --py3k W1619
params["threadCount"] = int((cpu_count() * 3) / 2)
- if (
- conditions.is_android(command_context)
- or command_context.substs.get("MOZ_BUILD_APP") == "b2g"
- ):
+ if conditions.is_android(command_context):
from mozrunner.devices.android_device import (
InstallIntent,
get_adb_path,
diff --git a/testing/xpcshell/moz-http2/moz-http2.js b/testing/xpcshell/moz-http2/moz-http2.js
index 933e99a005..30bf09cdac 100644
--- a/testing/xpcshell/moz-http2/moz-http2.js
+++ b/testing/xpcshell/moz-http2/moz-http2.js
@@ -56,7 +56,7 @@ var framer_module = node_http2_root + "/lib/protocol/framer";
var http2_framer = require(framer_module);
var Serializer = http2_framer.Serializer;
var originalTransform = Serializer.prototype._transform;
-var newTransform = function (frame, encoding, done) {
+var newTransform = function (frame) {
if (frame.type == "DATA") {
// Insert our empty DATA frame
const emptyFrame = {};
@@ -834,6 +834,16 @@ function handleRequest(req, res) {
});
push.writeHead(200, pushResponseHeaders);
push.end("ok");
+ } else if (u.pathname === "/hugecontinuedheaders") {
+ for (let i = 0; i < u.query.size; i++) {
+ res.setHeader(
+ "X-Test-Header-" + i,
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".repeat(1024)
+ );
+ }
+ res.writeHead(200);
+ res.end(content);
+ return;
} else if (u.pathname === "/altsvc1") {
if (
req.httpVersionMajor != 2 ||
@@ -879,9 +889,13 @@ function handleRequest(req, res) {
res.setHeader("Cache-Control", "no-cache");
res.setHeader(
"Alt-Svc",
- "h2=foo2.example.com:8000,h3-29=" +
- req.headers["x-altsvc"] +
- ",h3-30=foo2.example.com:8443"
+ "h2=foo2.example.com:8000,h3-29=" + req.headers["x-altsvc"]
+ );
+ } else if (u.pathname === "/http3-test3") {
+ res.setHeader("Cache-Control", "no-cache");
+ res.setHeader(
+ "Alt-Svc",
+ "h3-29=" + req.headers["x-altsvc"] + ",h3=" + req.headers["x-altsvc"]
);
}
// for use with test_trr.js
@@ -1753,7 +1767,7 @@ server.on("connection", function (socket) {
});
});
-server.on("connect", function (req, clientSocket, head) {
+server.on("connect", function (req, clientSocket) {
clientSocket.write(
"HTTP/1.1 404 Not Found\r\nProxy-agent: Node.js-Proxy\r\n\r\n"
);
diff --git a/testing/xpcshell/node-http2/lib/protocol/flow.js b/testing/xpcshell/node-http2/lib/protocol/flow.js
index 6bec857551..2768983374 100644
--- a/testing/xpcshell/node-http2/lib/protocol/flow.js
+++ b/testing/xpcshell/node-http2/lib/protocol/flow.js
@@ -172,7 +172,9 @@ Flow.prototype._read = function _read() {
// * otherwise, come back when the flow control window is positive
else {
- this.once('window_update', this._read);
+ if (!this.listenerCount('window_update')) {
+ this.once('window_update', this._read);
+ }
}
};
diff --git a/testing/xpcshell/remotexpcshelltests.py b/testing/xpcshell/remotexpcshelltests.py
index 8fe89ebfdd..3375b38a57 100644
--- a/testing/xpcshell/remotexpcshelltests.py
+++ b/testing/xpcshell/remotexpcshelltests.py
@@ -652,12 +652,7 @@ class XPCShellRemote(xpcshell.XPCShellTests, object):
self.pushLibs()
else:
- localB2G = os.path.join(self.options["objdir"], "dist", "b2g")
- if os.path.exists(localB2G):
- self.device.push(localB2G, self.remoteBinDir)
- self.device.chmod(self.remoteBinDir)
- else:
- raise Exception("unable to install gre: no APK and not b2g")
+ raise Exception("unable to install gre: no APK")
def pushLibs(self):
pushed_libs_count = 0
diff --git a/testing/xpcshell/selftest.py b/testing/xpcshell/selftest.py
index 864eb3e1e2..1919042049 100755
--- a/testing/xpcshell/selftest.py
+++ b/testing/xpcshell/selftest.py
@@ -112,7 +112,7 @@ add_test(function test_loop () {
});
"""
-PASSING_TEST_UNICODE = b"""
+PASSING_TEST_UNICODE = rb"""
function run_test () { run_next_test(); }
add_test(function test_unicode_print () {
@@ -288,7 +288,9 @@ no_such_var = "foo"; // assignment to undeclared variable
# A test that crashes outright.
TEST_CRASHING = """
function run_test () {
- const { ctypes } = ChromeUtils.import("resource://gre/modules/ctypes.jsm");
+ const { ctypes } = ChromeUtils.importESModule(
+ "resource://gre/modules/ctypes.sys.mjs"
+ );
let zero = new ctypes.intptr_t(8);
let badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
badptr.contents;
@@ -657,8 +659,8 @@ prefs = [
self.assertInLog("###!!! ASSERTION")
log_lines = self.log.getvalue().splitlines()
- line_pat = "#\d\d:"
- unknown_pat = "#\d\d\: \?\?\?\[.* \+0x[a-f0-9]+\]"
+ line_pat = r"#\d\d:"
+ unknown_pat = r"#\d\d\: \?\?\?\[.* \+0x[a-f0-9]+\]"
self.assertFalse(
any(re.search(unknown_pat, line) for line in log_lines),
"An stack frame without symbols was found in\n%s"