summaryrefslogtreecommitdiffstats
path: root/dom/performance/tests
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-29 12:11:55 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-29 12:11:55 +0200
commit39d4a11267fd707df04bb06a74e24f36e2dbcd28 (patch)
tree3c30c957fdeb03c356aa6bfe51867b38e0f05ff4 /dom/performance/tests
parent7ee501103ad2efe1d28ef3c10b4111a685746c06 (diff)
downloadUXP-39d4a11267fd707df04bb06a74e24f36e2dbcd28.tar
UXP-39d4a11267fd707df04bb06a74e24f36e2dbcd28.tar.gz
UXP-39d4a11267fd707df04bb06a74e24f36e2dbcd28.tar.lz
UXP-39d4a11267fd707df04bb06a74e24f36e2dbcd28.tar.xz
UXP-39d4a11267fd707df04bb06a74e24f36e2dbcd28.zip
Bug 1323941 - navigationStart should not be exposed to workers as timing attribute
https://hg.mozilla.org/mozilla-central/rev/6be7eb833b11
Diffstat (limited to 'dom/performance/tests')
-rw-r--r--dom/performance/tests/test_performance_user_timing.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/dom/performance/tests/test_performance_user_timing.js b/dom/performance/tests/test_performance_user_timing.js
index cd8261bbd..a15dbebb6 100644
--- a/dom/performance/tests/test_performance_user_timing.js
+++ b/dom/performance/tests/test_performance_user_timing.js
@@ -126,15 +126,18 @@ var steps = [
},
// Test measure
function () {
- ok(true, "Running measure addition with no start/end time test");
- performance.measure("test");
- var measures = performance.getEntriesByType("measure");
- is(measures.length, 1, "number of measures should be 1");
- var measure = measures[0];
- is(measure.name, "test", "measure name should be 'test'");
- is(measure.entryType, "measure", "measure type should be 'measure'");
- is(measure.startTime, 0, "measure start time should be zero");
- ok(measure.duration >= 0, "measure duration should not be negative");
+ // We don't have navigationStart in workers.
+ if ("window" in self) {
+ ok(true, "Running measure addition with no start/end time test");
+ performance.measure("test", "navigationStart");
+ var measures = performance.getEntriesByType("measure");
+ is(measures.length, 1, "number of measures should be 1");
+ var measure = measures[0];
+ is(measure.name, "test", "measure name should be 'test'");
+ is(measure.entryType, "measure", "measure type should be 'measure'");
+ is(measure.startTime, 0, "measure start time should be zero");
+ ok(measure.duration >= 0, "measure duration should not be negative");
+ }
},
function () {
ok(true, "Running measure addition with only start time test");