Revision 273bb41376c98c36e743186b63ec3cffa58a5339 authored by Ovidio Henriquez on 23 March 2018, 15:12:10 UTC, committed by Blink WPT Bot on 23 March 2018, 15:30:21 UTC
This change allows the removal of a descriptor to be simulated by the Bluetooth test interface. A generated test script was also converted to test the new interface. BUG=569709 Change-Id: Id4286a3e44cd04ee1b371938f1ef89f33458269c Reviewed-on: https://chromium-review.googlesource.com/972334 Reviewed-by: Giovanni Ortuño Urquidi <ortuno@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Conley Owens <cco3@chromium.org> Commit-Queue: Ovidio Henriquez <odejesush@chromium.org> Cr-Commit-Position: refs/heads/master@{#545448}
1 parent 2d1fd9e
window-worker-timeOrigin.window.js
"use strict"
// https://w3c.github.io/hr-time/#time-origin
async_test(function(test) {
// Cache global time before starting worker
const globalTimeOrigin = performance.timeOrigin;
const globalNowBeforeWorkerStart = performance.now();
// Start worker and retrieve time
const workerScript = "postMessage({timeOrigin: performance.timeOrigin, now: performance.now()})";
const blob = new Blob([workerScript]);
let worker = new Worker(URL.createObjectURL(blob));
worker.addEventListener("message", test.step_func_done(function(event) {
const workerTimeOrigin = event.data.timeOrigin;
const workerNow = event.data.now;
assert_not_equals(workerTimeOrigin, 0, "worker timeOrigin must not be 0");
assert_not_equals(performance.timeOrigin, 0, "Document timeOrigin must not be 0");
assert_equals(globalTimeOrigin, performance.timeOrigin, "timeOrigin should not be changed in same document mode");
assert_less_than(globalTimeOrigin, workerTimeOrigin, "Document timeOrigin must be earlier than worker timeOrigin");
// Document and worker's now() start from their respective timeOrigins.
const timeDiff = workerTimeOrigin - globalTimeOrigin; // convert worker's time to Document time.
assert_less_than(globalTimeOrigin + globalNowBeforeWorkerStart, globalTimeOrigin + timeDiff + workerNow, "Document old now is earlier than worker now.");
// Comparing timing between Document and worker threads could be delicate as it relies on the thread implementation and could be subject to race conditions.
}));
}, 'timeOrigin and now() should be correctly ordered between window and worker');
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...