Automatic update from web-platform-tests [PATCH 3/4] Revert "compute pressure: Add OwnContributionEstimate to API." This reverts commit 07a693411a90509f07cc0cc59c93684262c5d902. This feature is creating information leak. There is no active development on this feature anymore, therefore it was decided to revert the patches related to this feature. Bug: 513009005 Change-Id: I3e57e1fb6d4160539c6c46ca5bd96bbd4468dbb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7863881 Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Commit-Queue: Wang, Wei4 <wei4.wang@intel.com> Reviewed-by: Reilly Grant <reillyg@chromium.org> Reviewed-by: Matt Reynolds <mattreynolds@chromium.org> Reviewed-by: Philip Jägenstedt <foolip@chromium.org> Reviewed-by: Ian Vollick <vollick@chromium.org> Cr-Commit-Position: refs/heads/main@{#1635414} -- wpt-commits: 63d179e599b4e09a1f197d07fa4f782ef0204235 wpt-pr: 60163
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
'use strict';
|
|
|
|
importScripts('/resources/testharness.js');
|
|
importScripts('/common/utils.js');
|
|
importScripts('/common/dispatcher/dispatcher.js');
|
|
|
|
// Only used by some tests.
|
|
importScripts('/compute-pressure/resources/sync-pressure-observer.js');
|
|
|
|
function send_message(message) {
|
|
return new Promise((resolve, reject) => {
|
|
const id = token();
|
|
message.id = id;
|
|
|
|
addEventListener('message', function listener(e) {
|
|
if (!e.data.command || e.data.id !== id) {
|
|
return;
|
|
}
|
|
|
|
removeEventListener('message', listener);
|
|
|
|
if (e.data.command !== message.command) {
|
|
reject(`Expected reply with command '${message.command}', got '${
|
|
e.data.command}' instead`);
|
|
return;
|
|
}
|
|
if (e.data.error) {
|
|
reject(e.data.error);
|
|
return;
|
|
}
|
|
resolve();
|
|
});
|
|
|
|
postMessage(message);
|
|
});
|
|
}
|
|
|
|
function create_virtual_pressure_source(source, options = {}) {
|
|
return send_message({command: 'create', params: [source, options]});
|
|
}
|
|
|
|
function remove_virtual_pressure_source(source) {
|
|
return send_message({command: 'remove', params: [source]});
|
|
}
|
|
|
|
function update_virtual_pressure_source(source, state) {
|
|
return send_message({command: 'update', params: [source, state]});
|
|
}
|
|
|
|
const uuid = new URLSearchParams(location.search).get('uuid');
|
|
const executor = new Executor(uuid);
|