зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1482283 [wpt PR 12390] - Rewrite Budget API IDL test to use idl_test, a=testonly
Automatic update from web-platform-testsRewrite Budget API IDL test to use idl_test (#12390) -- wpt-commits: 13f24abbc0da9d73ede59516bb6289592ff94216 wpt-pr: 12390
This commit is contained in:
Родитель
b16c1b266f
Коммит
413627c605
|
@ -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": [
|
||||
|
|
|
@ -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'] });
|
||||
}
|
||||
}
|
||||
);
|
|
@ -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.');
|
Загрузка…
Ссылка в новой задаче