mirror of
https://github.com/servo/servo.git
synced 2025-08-24 22:58:21 +01:00
Update web-platform-tests to revision 9919d0f04266001686c09d47ff6e25c98b48d91f
This commit is contained in:
parent
026e550d35
commit
e7fcc8e274
453 changed files with 7751 additions and 2288 deletions
|
@ -0,0 +1,64 @@
|
|||
test(function() {
|
||||
performance.clearMarks();
|
||||
const detail = { randomInfo: 123 }
|
||||
const markEntry = new PerformanceMark("A", { detail });
|
||||
assert_equals(markEntry.detail.randomInfo, detail.randomInfo);
|
||||
assert_not_equals(markEntry.detail, detail);
|
||||
}, "The detail property in the mark constructor should be structured-clone.");
|
||||
|
||||
test(function() {
|
||||
performance.clearMarks();
|
||||
const detail = { randomInfo: 123 }
|
||||
const markEntry = performance.mark("A", { detail });
|
||||
assert_not_equals(markEntry.detail, detail);
|
||||
}, "The detail property in the mark method should be structured-clone.");
|
||||
|
||||
test(function() {
|
||||
performance.clearMarks();
|
||||
const markEntry = performance.mark("A");
|
||||
assert_equals(markEntry.detail, null);
|
||||
}, "When accessing detail from a mark entry and the detail is not provided, just return a null value.");
|
||||
|
||||
test(function() {
|
||||
performance.clearMarks();
|
||||
const detail = { unserializable: Symbol() };
|
||||
assert_throws("DataCloneError", ()=>{
|
||||
new PerformanceMark("A", { detail });
|
||||
}, "Trying to structured-serialize a Symbol.");
|
||||
}, "Mark: Throw an exception when the detail property cannot be structured-serialized.");
|
||||
|
||||
test(function() {
|
||||
performance.clearMeasures();
|
||||
const detail = { randomInfo: 123 }
|
||||
const measureEntry = performance.measure("A", { detail });
|
||||
assert_not_equals(measureEntry.detail, detail);
|
||||
}, "The detail property in the measure method should be structured-clone.");
|
||||
|
||||
test(function() {
|
||||
performance.clearMeasures();
|
||||
const detail = { randomInfo: 123 }
|
||||
const measureEntry = performance.measure("A", { detail });
|
||||
assert_equals(measureEntry.detail, measureEntry.detail);
|
||||
}, "The detail property in the measure method should be the same reference.");
|
||||
|
||||
test(function() {
|
||||
performance.clearMeasures();
|
||||
const measureEntry = performance.measure("A");
|
||||
assert_equals(measureEntry.detail, null);
|
||||
}, "When accessing detail from a measure entry and the detail is not provided, just return a null value.");
|
||||
|
||||
test(function() {
|
||||
performance.clearMeasures();
|
||||
const detail = { unserializable: Symbol() };
|
||||
assert_throws("DataCloneError", ()=>{
|
||||
performance.measure("A", { detail });
|
||||
}, "Trying to structured-serialize a Symbol.");
|
||||
}, "Measure: Throw an exception when the detail property cannot be structured-serialized.");
|
||||
|
||||
test(function() {
|
||||
const bar = { 1: 2 };
|
||||
const detail = { foo: 1, bar };
|
||||
const mark = performance.mark("m", { detail });
|
||||
detail.foo = 2;
|
||||
assert_equals(mark.detail.foo, 1);
|
||||
}, "The detail object is cloned when passed to mark API.");
|
Loading…
Add table
Add a link
Reference in a new issue