Skip to content

Commit 18a22ad

Browse files
committed
Bug 1966633 [wpt PR 52565] - compute pressure: Add OwnContributionEstimate to API.,
Automatic update from web-platform-tests compute pressure: Add OwnContributionEstimate to API. This patch is the second part of the two patches patchset to implement OnwContributionEstimate feature described in [1]. The first patch for crbug.com/402033762 addressed the implementation-specific part, modifying //services and //content. This patch exposes OwnContributionEstimate to Compute Pressure API. The CDP has been also modified to also include a virtual estimate value. Testdriver code was also modified to support estimate as a virtual source input parameter. [1] https://w3c.github.io/compute-pressure/?experimental=1#the-owncontributionestimate-attribute Bug: 402033762 Change-Id: Ie4ff1294aea757700fb1cf6b5f22f18906867428 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6373001 Reviewed-by: Alex Rudenko <alexrudenkochromium.org> Reviewed-by: Reilly Grant <reillygchromium.org> Reviewed-by: Koji Ishii <kojiichromium.org> Reviewed-by: Danil Somsikov <dsvchromium.org> Commit-Queue: Arnaud Mandy <arnaud.mandyintel.com> Cr-Commit-Position: refs/heads/main{#1460595} -- wpt-commits: 9c26aadd95c82cc819cb766ea69946467cf6d5ea wpt-pr: 52565 Differential Revision: https://phabricator.services.mozilla.com/D250621 UltraBlame original commit: 468bdc0360bf58e5e227ac664ad68843b4dacb82
1 parent c6127a1 commit 18a22ad

File tree

3 files changed

+219
-0
lines changed

3 files changed

+219
-0
lines changed

testing/web-platform/tests/compute-pressure/compute_pressure_basic.https.window.js

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ cpu
200200
'
201201
critical
202202
'
203+
0
204+
.
205+
5
203206
)
204207
.
205208
catch
@@ -258,11 +261,216 @@ number
258261
'
259262
)
260263
;
264+
assert_equals
265+
(
266+
typeof
267+
changes
268+
[
269+
0
270+
]
271+
.
272+
ownContributionEstimate
273+
'
274+
number
275+
'
276+
)
277+
;
278+
assert_equals
279+
(
280+
changes
281+
[
282+
0
283+
]
284+
.
285+
ownContributionEstimate
286+
0
287+
.
288+
5
289+
)
290+
;
291+
}
292+
'
293+
Basic
294+
functionality
295+
test
296+
'
297+
)
298+
;
299+
pressure_test
300+
(
301+
async
302+
(
303+
t
304+
)
305+
=
306+
>
307+
{
308+
await
309+
create_virtual_pressure_source
310+
(
311+
'
312+
cpu
313+
'
314+
)
315+
;
316+
t
317+
.
318+
add_cleanup
319+
(
320+
async
321+
(
322+
)
323+
=
324+
>
325+
{
326+
await
327+
remove_virtual_pressure_source
328+
(
329+
'
330+
cpu
331+
'
332+
)
333+
;
334+
}
335+
)
336+
;
337+
const
338+
changes
339+
=
340+
await
341+
new
342+
Promise
343+
(
344+
(
345+
resolve
346+
reject
347+
)
348+
=
349+
>
350+
{
351+
const
352+
observer
353+
=
354+
new
355+
PressureObserver
356+
(
357+
resolve
358+
)
359+
;
360+
t
361+
.
362+
add_cleanup
363+
(
364+
(
365+
)
366+
=
367+
>
368+
observer
369+
.
370+
disconnect
371+
(
372+
)
373+
)
374+
;
375+
observer
376+
.
377+
observe
378+
(
379+
'
380+
cpu
381+
'
382+
)
383+
.
384+
catch
385+
(
386+
reject
387+
)
388+
;
389+
update_virtual_pressure_source
390+
(
391+
'
392+
cpu
393+
'
394+
'
395+
critical
396+
'
397+
)
398+
.
399+
catch
400+
(
401+
reject
402+
)
403+
;
404+
}
405+
)
406+
;
407+
assert_equals
408+
(
409+
1
410+
changes
411+
.
412+
length
413+
)
414+
;
415+
assert_equals
416+
(
417+
changes
418+
[
419+
0
420+
]
421+
.
422+
state
423+
'
424+
critical
425+
'
426+
)
427+
;
428+
assert_equals
429+
(
430+
changes
431+
[
432+
0
433+
]
434+
.
435+
source
436+
'
437+
cpu
438+
'
439+
)
440+
;
441+
assert_equals
442+
(
443+
typeof
444+
changes
445+
[
446+
0
447+
]
448+
.
449+
time
450+
'
451+
number
452+
'
453+
)
454+
;
455+
assert_equals
456+
(
457+
changes
458+
[
459+
0
460+
]
461+
.
462+
ownContributionEstimate
463+
null
464+
)
465+
;
261466
}
262467
'
263468
Basic
264469
functionality
265470
test
471+
with
472+
no
473+
ownContributionEstimate
266474
'
267475
)
268476
;

testing/web-platform/tests/compute-pressure/compute_pressure_duplicate_updates.https.window.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ cpu
7373
'
7474
critical
7575
'
76+
0
77+
.
78+
2
7679
)
7780
;
7881
await
@@ -111,6 +114,9 @@ cpu
111114
'
112115
critical
113116
'
117+
0
118+
.
119+
2
114120
)
115121
;
116122
await
@@ -153,6 +159,9 @@ cpu
153159
nominal
154160
'
155161
)
162+
0
163+
.
164+
2
156165
;
157166
await
158167
syncObserver

testing/web-platform/tests/compute-pressure/resources/worker-support.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ update_virtual_pressure_source
273273
(
274274
source
275275
state
276+
estimate
276277
)
277278
{
278279
return
@@ -289,6 +290,7 @@ params
289290
[
290291
source
291292
state
293+
estimate
292294
]
293295
}
294296
)

0 commit comments

Comments
 (0)