From 39d4a11267fd707df04bb06a74e24f36e2dbcd28 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Sun, 29 Apr 2018 12:11:55 +0200 Subject: Bug 1323941 - navigationStart should not be exposed to workers as timing attribute https://hg.mozilla.org/mozilla-central/rev/6be7eb833b11 --- testing/web-platform/meta/MANIFEST.json | 4 +++ .../user-timing/resources/webperftestharness.js | 2 +- ...ception_when_invoke_with_timing_attributes.html | 32 ++++++++++++++++++++++ ...exception_when_invoke_with_timing_attributes.js | 14 ++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 testing/web-platform/tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html create mode 100644 testing/web-platform/tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.js (limited to 'testing') diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index 3c7df67fa..496f8e3cb 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -31099,6 +31099,10 @@ "path": "user-timing/test_user_timing_mark.html", "url": "/user-timing/test_user_timing_mark.html" }, + { + "path": "user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html", + "url": "/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html" + }, { "path": "user-timing/test_user_timing_mark_and_measure_exception_when_invoke_without_parameter.html", "url": "/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_without_parameter.html" diff --git a/testing/web-platform/tests/user-timing/resources/webperftestharness.js b/testing/web-platform/tests/user-timing/resources/webperftestharness.js index 750946dde..f1597bbe7 100644 --- a/testing/web-platform/tests/user-timing/resources/webperftestharness.js +++ b/testing/web-platform/tests/user-timing/resources/webperftestharness.js @@ -12,7 +12,7 @@ policies and contribution forms [3]. // Helper Functions for NavigationTiming W3C tests // -var performanceNamespace = window.performance; +var performanceNamespace = self.performance; var timingAttributes = [ 'connectEnd', 'connectStart', diff --git a/testing/web-platform/tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html b/testing/web-platform/tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html new file mode 100644 index 000000000..aea8cb6e9 --- /dev/null +++ b/testing/web-platform/tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.html @@ -0,0 +1,32 @@ + + + + + exception test of performance.mark and performance.measure + + + + + + + +

Description

+

This test validates exception scenarios of invoking mark() and measure() with timing attributes as value.

+
+ + diff --git a/testing/web-platform/tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.js b/testing/web-platform/tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.js new file mode 100644 index 000000000..f015402f9 --- /dev/null +++ b/testing/web-platform/tests/user-timing/test_user_timing_mark_and_measure_exception_when_invoke_with_timing_attributes.js @@ -0,0 +1,14 @@ +importScripts("/resources/testharness.js"); +importScripts("resources/webperftestharness.js"); + +test(function() { + for (var i in timingAttributes) { + performance.mark(timingAttributes[i]); + performance.clearMarks(timingAttributes[i]); + + performance.measure(timingAttributes[i]); + performance.clearMeasures(timingAttributes[i]); + } +}, "performance.mark and performance.measure should not throw if used with timing attribute values in workers"); + +done(); -- cgit v1.2.3