Bug 1773946 [wpt PR 34387] - [ComputePressure] Make ComputePressure as a service., a=testonly
authorWei4 Wang <wei4.wang@intel.com>
Wed, 20 Jul 2022 11:00:01 +0000
changeset 624690 b934ef33693a7edbaa467b97f2dee527ab39b1cf
parent 624689 3e47d85da58f49216539222a2dd20c02a934d6f8
child 624691 838da9274fda72f6b8d8dffb562531afd037dd6f
push id166538
push userwptsync@mozilla.com
push dateThu, 21 Jul 2022 00:36:02 +0000
treeherderautoland@520b7539f9db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1773946, 34387, 1205695, 1311945, 3661519, 1025483
milestone104.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 1773946 [wpt PR 34387] - [ComputePressure] Make ComputePressure as a service., a=testonly Automatic update from web-platform-tests [ComputePressure] Make ComputePressure as a service. The patch makes ComputePressure as a service and the major changes are: 1. Move ComputePressureManager and related classes from content/browser to services/device. Rename ComputePressureManager to ComputePressureManagerImpl. 2. Rename ComputePressureHost to ComputePressureServiceImpl. 3. ComputePressureSample data are collected in service now and then send to ComputePressureServiceImpl. If the data changes and meets frequency requirement, ComputePressureServiceImpl will send the data to Blink. 4. CpuProbe collects data only when there is active ComputePressureObserver. It stops collecting when all ComputePressureObservers become inactive. The compute_pressure_different_quantizations_across_iframes test fails in this patch. However, there is no concept of the quantization in the newest spec any more and we will remove this test in the future. Bug: 1205695, 1311945 Change-Id: I388ce2ea3d7be2e717c080d92c77b8d0b3570f03 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3661519 Reviewed-by: Alexander Timin <altimin@chromium.org> Reviewed-by: Matthew Denton <mpdenton@chromium.org> Reviewed-by: Reilly Grant <reillyg@chromium.org> Reviewed-by: Nico Weber <thakis@chromium.org> Commit-Queue: Wei4 Wang <wei4.wang@intel.com> Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com> Reviewed-by: Joshua Bell <jsbell@chromium.org> Cr-Commit-Position: refs/heads/main@{#1025483} -- wpt-commits: 8eefb4deef4e29455582ba460bfd1fcc19abb5a6 wpt-pr: 34387
testing/web-platform/tests/compute-pressure/compute_pressure_detached_iframe.tentative.https.html
testing/web-platform/tests/compute-pressure/compute_pressure_different_quantizations.tentative.https.window.js
--- a/testing/web-platform/tests/compute-pressure/compute_pressure_detached_iframe.tentative.https.html
+++ b/testing/web-platform/tests/compute-pressure/compute_pressure_detached_iframe.tentative.https.html
@@ -24,17 +24,17 @@ promise_test(async t => {
   const observer = new frame_window.ComputePressureObserver(
       () => {},
       {cpuUtilizationThresholds: [0.5], cpuSpeedThresholds: [0.5]});
   const iframe_DOMException = frame_window.DOMException;
 
   iframe.remove();
 
   // Calling observe() from a detached iframe should fail but not crash.
-  await promise_rejects_dom(t, 'InvalidStateError', iframe_DOMException,
+  await promise_rejects_dom(t, 'NotSupportedError', iframe_DOMException,
                             observer.observe('cpu'));
 }, 'ComputePressureObserver.observe() on detached frame rejects');
 
 promise_test(async t => {
   const iframe = document.createElement('iframe');
   document.body.appendChild(iframe);
   const frame_window = iframe.contentWindow;
 
--- a/testing/web-platform/tests/compute-pressure/compute_pressure_different_quantizations.tentative.https.window.js
+++ b/testing/web-platform/tests/compute-pressure/compute_pressure_different_quantizations.tentative.https.window.js
@@ -1,17 +1,17 @@
 'use strict';
 
 promise_test(async t => {
   const observer1_updates = [];
   const observer1 = new ComputePressureObserver(
       update => { observer1_updates.push(update); },
       {cpuUtilizationThresholds: [0.5], cpuSpeedThresholds: [0.5]});
   t.add_cleanup(() => observer1.disconnect());
-  // Ensure that observer1's quantization scheme gets registered as the origin's
+  // Ensure that observer1's quantization scheme gets registered as the frame's
   // scheme before observer2 starts.
   await observer1.observe('cpu');
 
   const observer2_updates = [];
   await new Promise((resolve, reject) => {
     const observer2 = new ComputePressureObserver(
         update => {
           observer2_updates.push(update);
@@ -71,9 +71,9 @@ promise_test(async t => {
 
   assert_equals(observer3_updates.length, 1);
   assert_in_array(observer3_updates[0].cpuUtilization, [0.375, 0.875],
                   'cpuUtilization quantization');
   assert_in_array(observer3_updates[0].cpuSpeed, [0.125, 0.625],
                   'cpuSpeed quantization');
 
 }, 'ComputePressureObserver with a new quantization schema stops all ' +
-   'other active observers');
+   'other active observers in the same frame');