Bug 1507660 [wpt PR 14084] - [UserTimingL3] Fix meature, mark API feature detection, a=testonly
☠☠ backed out by 46ad93280b06 ☠ ☠
authorLiquan(Max) Gu <maxlg@chromium.org>
Mon, 19 Nov 2018 18:45:43 +0000
changeset 503734 0143d49ed65b65beab2f2f6d9c74ca58f590e2f6
parent 503733 2c739b93be1e45dc9695653334e34a921e60d3f5
child 503735 0b2f801856141bb6a7673db5cb370eaf5e813ba9
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1507660, 14084, 1338225, 608552
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1507660 [wpt PR 14084] - [UserTimingL3] Fix meature, mark API feature detection, a=testonly Automatic update from web-platform-tests[UserTimingL3] Fix meature, mark API feature detection UserTimingL3 uses returned value for feature detection. If measure and mark API returns null, the APIs are L2 API; If the APIs return an entry, the APIs are L3 API. However, in the current implementation, when L3 API is enabled, the APIs do not always return the created entry. This CL is to fix this bug, and add layout tests to verify it. Change-Id: I9854f0abd0d64a3334701e09d6ce0fc245fcca3e Reviewed-on: https://chromium-review.googlesource.com/c/1338225 Commit-Queue: Liquan (Max) Gǔ <maxlg@chromium.org> Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Cr-Commit-Position: refs/heads/master@{#608552} -- wpt-commits: a4efb68eb4bb30453a6c958ad58f8c2540dc967e wpt-pr: 14084
testing/web-platform/tests/user-timing/mark-measure-return-null.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/user-timing/mark-measure-return-null.html
@@ -0,0 +1,46 @@
+<!DOCTYPE HTML>
+<meta charset=utf-8>
+<title>User Timing: L2 APIs return null</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<p>User Timing: L2 APIs return null</p>
+<div id="log"></div>
+<script>
+  async_test(function (t) {
+    self.performance.clearMeasures();
+    const measure = self.performance.measure("measure1");
+    assert_equals(measure, null);
+    t.done();
+  }, "L2: performance.measure(name) should return null.");
+
+  async_test(function (t) {
+    self.performance.clearMeasures();
+    self.performance.mark("1");
+    const measure = self.performance.measure("measure2", 1);
+    assert_equals(measure, null);
+    t.done();
+  }, "L2: performance.measure(name, param1) should return null.");
+
+  async_test(function (t) {
+    self.performance.clearMeasures();
+    self.performance.mark("1");
+    self.performance.mark("2");
+    const measure = self.performance.measure("measure3", 1, 2);
+    assert_equals(measure, null);
+    t.done();
+  }, "L2: performance.measure(name, param1, param2) should return null.");
+
+  async_test(function (t) {
+    self.performance.clearMarks();
+    const mark = self.performance.mark("mark1");
+    assert_equals(mark, null);
+    t.done();
+  }, "L2: performance.mark(name) should return null.");
+
+  async_test(function (t) {
+    self.performance.clearMarks();
+    const mark = self.performance.mark("mark2", { startTime: 34 });
+    assert_equals(mark, null);
+    t.done();
+  }, "L2: performance.mark(name, param) should return null.");
+</script>