Bug 1504402 [wpt PR 13878] - Count partial mixins as tested deps, a=testonly

Automatic update from web-platform-testsCount partial mixins as tested deps (#13878)

--

wpt-commits: 4176e9ef5f720910505d3af6c22a0b8002a4a9a8
wpt-pr: 13878
This commit is contained in:
Luke Bjerring 2018-11-13 13:41:13 +00:00 коммит произвёл moz-wptsync-bot
Родитель c1b93fa20b
Коммит ebe27fa4b7
3 изменённых файлов: 56 добавлений и 5 удалений

Просмотреть файл

@ -298,15 +298,29 @@ IdlArray.prototype.add_dependency_idls = function(raw_idls, options)
}.bind(this));
deps.forEach(function(name) {
new_options.only.push(name);
if (!new_options.only.includes(name)) {
new_options.only.push(name);
}
const follow_up = new Set();
for (const dep_type of ["inheritance", "implements", "includes"]) {
if (parsed[dep_type]) {
const inheriting = parsed[dep_type];
const inheritor = parsed.name || parsed.target;
for (const dep of [inheriting, inheritor]) {
new_options.only.push(dep);
const deps = [inheriting];
// For A includes B, we can ignore A, unless B (or some of its
// members) is being tested.
if (dep_type !== "includes"
|| inheriting in this.members && !this.members[inheriting].untested
|| this.partials.some(function(p) {
return p.name === inheriting;
})) {
deps.push(inheritor);
}
for (const dep of deps) {
if (!new_options.only.includes(dep)) {
new_options.only.push(dep);
}
all_deps.add(dep);
follow_up.add(dep);
}
@ -320,7 +334,7 @@ IdlArray.prototype.add_dependency_idls = function(raw_idls, options)
next.forEach(process);
}
}
});
}.bind(this));
}.bind(this);
for (let parsed of parsed_idls) {

Просмотреть файл

@ -63,6 +63,37 @@
namespace E {};`);
idlArray.collapse_partials();
})();
(() => {
const idlArray = new IdlArray();
idlArray.add_idls(`
partial interface F {};
partial interface mixin G{};
`);
idlArray.add_dependency_idls(`
interface F {};
interface mixin G {};
interface mixin H {};
F includes H;
I includes H;
J includes G;
interface K : J {};
interface L : F {};
`);
test(() => {
// F is tested, so H is a dep.
assert_true('F' in idlArray.includes, 'Fs includes should be picked up');
assert_true(idlArray.includes.F.includes('H'), 'H should be picked up');
// H is not tested, so I is not a dep.
assert_false('I' in idlArray.includes, 'I should be ignored');
// G is a dep, so J is a dep.
assert_true('J' in idlArray.includes, 'J should be picked up');
// But, K isn't a dep just because of J.
assert_false('K' in idlArray.members, 'K should be ignored');
// L inherits F, so should be picked up.
assert_false('L' in idlArray.members, 'L should be picked up');
}, 'partial mixin dep implications');
})();
</script>
<script type="text/json" id="expected">
{
@ -118,6 +149,12 @@
"status_string": "FAIL",
"properties": {},
"message": "assert_true: Original E definition should have type interface expected true got false"
},
{
"name": "partial mixin dep implications",
"status_string": "PASS",
"properties": {},
"message": null
}
],
"type": "complete"

Просмотреть файл

@ -7,7 +7,7 @@
idl_test(
['selection-api'],
['dom', 'html'],
['html', 'dom'],
idlArray => {
idlArray.add_objects({
Window: ['window'],