diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json index c983e499cd11..4090e4497179 100644 --- a/testing/web-platform/meta/MANIFEST.json +++ b/testing/web-platform/meta/MANIFEST.json @@ -323728,13 +323728,13 @@ } ] ], - "budget-api/interfaces.any.js": [ + "budget-api/idlharness.https.any.js": [ [ - "/budget-api/interfaces.any.html", + "/budget-api/idlharness.https.any.html", {} ], [ - "/budget-api/interfaces.any.worker.html", + "/budget-api/idlharness.https.any.worker.html", {} ] ], @@ -432575,8 +432575,8 @@ "6cc0000f6ff7547e1b1bc635cbd0cabf0754675a", "support" ], - "budget-api/interfaces.any.js": [ - "5a87b3f8a2f42627063cfbb9a79e8b0cd63d63e8", + "budget-api/idlharness.https.any.js": [ + "335c7a60a4dc8daecd3a2b28b86438698ac06484", "testharness" ], "check_stability.ini": [ diff --git a/testing/web-platform/tests/budget-api/idlharness.https.any.js b/testing/web-platform/tests/budget-api/idlharness.https.any.js new file mode 100644 index 000000000000..335c7a60a4dc --- /dev/null +++ b/testing/web-platform/tests/budget-api/idlharness.https.any.js @@ -0,0 +1,24 @@ +// META: script=/resources/WebIDLParser.js +// META: script=/resources/idlharness.js + +'use strict'; + +// See https://wicg.github.io/budget-api/ + +idl_test( + ['budget-api'], + ['html'], + async idl_array => { + idl_array.add_objects({ BudgetService: ['navigator.budget'] }); + if (self.Window) { + idl_array.add_objects({ Navigator: ['navigator'] }); + } else { + idl_array.add_objects({ WorkerNavigator: ['navigator'] }); + } + const budgetStates = await navigator.budget.getBudget(); + if (budgetStates.length) { + self.budgetState = budgetStates[0]; + idl_array.add_objects({ BudgetState: ['budgetState'] }); + } + } +); diff --git a/testing/web-platform/tests/budget-api/interfaces.any.js b/testing/web-platform/tests/budget-api/interfaces.any.js deleted file mode 100644 index 5a87b3f8a2f4..000000000000 --- a/testing/web-platform/tests/budget-api/interfaces.any.js +++ /dev/null @@ -1,19 +0,0 @@ -// META: script=/resources/WebIDLParser.js -// META: script=/resources/idlharness.js - -'use strict'; - -// See https://wicg.github.io/budget-api/ - -promise_test(async () => { - const html = await fetch('/interfaces/html.idl').then(r => r.text()); - const workers = await fetch('/interfaces/dedicated-workers.idl').then(r => r.text()); - const idl = await fetch('/interfaces/budget-api.idl').then(r => r.text()); - - const idlArray = new IdlArray(); - idlArray.add_idls(idl); - idlArray.add_dependency_idls(html); - idlArray.add_dependency_idls(workers); - idlArray.test(); - done(); -}, 'budget-api interfaces.');