summaryrefslogtreecommitdiffstats
path: root/js/src/tests
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests')
-rw-r--r--js/src/tests/lib/progressbar.py4
-rw-r--r--js/src/tests/lib/tasks_unix.py8
-rw-r--r--js/src/tests/lib/tasks_win.py4
-rw-r--r--js/src/tests/shell.js15
4 files changed, 8 insertions, 23 deletions
diff --git a/js/src/tests/lib/progressbar.py b/js/src/tests/lib/progressbar.py
index 29361660d..da578783d 100644
--- a/js/src/tests/lib/progressbar.py
+++ b/js/src/tests/lib/progressbar.py
@@ -28,7 +28,7 @@ class ProgressBar(object):
# field in the counters map.
self.limit = limit # int: The value of 'current' equal to 100%.
self.limit_digits = int(math.ceil(math.log10(self.limit))) # int: max digits in limit
- self.t0 = datetime.now() # datetime: The start time.
+ self.t0 = datetime.utcnow() # datetime: The start time.
# Compute the width of the counters and build the format string.
self.counters_width = 1 # [
@@ -68,7 +68,7 @@ class ProgressBar(object):
sys.stdout.write(bar + '|')
# Update the bar.
- dt = datetime.now() - self.t0
+ dt = datetime.utcnow() - self.t0
dt = dt.seconds + dt.microseconds * 1e-6
sys.stdout.write('{:6.1f}s'.format(dt))
Terminal.clear_right()
diff --git a/js/src/tests/lib/tasks_unix.py b/js/src/tests/lib/tasks_unix.py
index 655033522..487c749ee 100644
--- a/js/src/tests/lib/tasks_unix.py
+++ b/js/src/tests/lib/tasks_unix.py
@@ -14,7 +14,7 @@ class Task(object):
self.pid = pid
self.stdout = stdout
self.stderr = stderr
- self.start = datetime.now()
+ self.start = datetime.utcnow()
self.out = []
self.err = []
@@ -59,7 +59,7 @@ def get_max_wait(tasks, timeout):
# If a timeout is supplied, we need to wake up for the first task to
# timeout if that is sooner.
if timeout:
- now = datetime.now()
+ now = datetime.utcnow()
timeout_delta = timedelta(seconds=timeout)
for task in tasks:
remaining = task.start + timeout_delta - now
@@ -136,7 +136,7 @@ def timed_out(task, timeout):
timed_out always returns False).
"""
if timeout:
- now = datetime.now()
+ now = datetime.utcnow()
return (now - task.start) > timedelta(seconds=timeout)
return False
@@ -175,7 +175,7 @@ def reap_zombies(tasks, timeout):
''.join(ended.out),
''.join(ended.err),
returncode,
- (datetime.now() - ended.start).total_seconds(),
+ (datetime.utcnow() - ended.start).total_seconds(),
timed_out(ended, timeout)))
return tasks, finished
diff --git a/js/src/tests/lib/tasks_win.py b/js/src/tests/lib/tasks_win.py
index 7a4540c60..a99640abb 100644
--- a/js/src/tests/lib/tasks_win.py
+++ b/js/src/tests/lib/tasks_win.py
@@ -36,7 +36,7 @@ def _do_work(qTasks, qResults, qWatch, prefix, run_skipped, timeout, show_cmd):
cmd = test.get_command(prefix)
if show_cmd:
print(escape_cmdline(cmd))
- tStart = datetime.now()
+ tStart = datetime.utcnow()
proc = subprocess.Popen(cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
@@ -49,7 +49,7 @@ def _do_work(qTasks, qResults, qWatch, prefix, run_skipped, timeout, show_cmd):
qWatch.put(TaskFinishedMarker)
# Create a result record and forward to result processing.
- dt = datetime.now() - tStart
+ dt = datetime.utcnow() - tStart
result = TestOutput(test, cmd, out, err, proc.returncode, dt.total_seconds(),
dt > timedelta(seconds=timeout))
qResults.put(result)
diff --git a/js/src/tests/shell.js b/js/src/tests/shell.js
index 36dbc79da..c7a57953e 100644
--- a/js/src/tests/shell.js
+++ b/js/src/tests/shell.js
@@ -32,8 +32,6 @@
// Certain cached functionality only exists (and is only needed) when
// running in the browser. Segregate that caching here.
- var SpecialPowersSetGCZeal =
- global.SpecialPowers ? global.SpecialPowers.setGCZeal : undefined;
}
var runningInShell = typeof window === "undefined";
@@ -205,19 +203,6 @@
global.quit = quit;
}
- var gczeal = global.gczeal;
- if (typeof gczeal !== "function") {
- if (typeof SpecialPowersSetGCZeal === "function") {
- gczeal = function gczeal(z) {
- SpecialPowersSetGCZeal(z);
- };
- } else {
- gczeal = function() {}; // no-op if not available
- }
-
- global.gczeal = gczeal;
- }
-
/******************************************************
* TEST METADATA EXPORTS (these are of dubious value) *
******************************************************/