Skip to content

Commit

Permalink
Bug 1885216 [wpt PR 45091] - Use clearer variable names in grid WPT t…
Browse files Browse the repository at this point in the history
…o avoid spurious MISSING test results., a=testonly

Automatic update from web-platform-tests
Use clearer variable names in grid WPT to avoid spurious MISSING test results. (#45091)

Fixes web-platform-tests/interop#646

This patch improves WPT grid-shorthand-serialization.html to better distinguish
between the `cssText` function-param vs. the serialization of that string that
the test reads back from the style system.

As of this patch, we'll now use the function-param (not its serialization) when
generating the subtest "name" value that we pass to the test(...) function.
This makes for more consistent output and removes the possibility for
browser-specific serialization-quirks to influence the subtest-name, as
discussed in web-platform-tests/interop#646

The test continues to use the serialized value (under a new/clearer variable
name) in the assert_true() expression, though; this way, if the test fails, it
remains easy to see the actual strings that are involved in the `indexOf`
operation that's causing the test-failure.
--

wpt-commits: 227a77f3eac2653c34706d578bdd709b3897e962
wpt-pr: 45091
  • Loading branch information
dholbert authored and moz-wptsync-bot committed Mar 15, 2024
1 parent 3a184da commit 6e98820
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@
}

if (declarations) {
let cssText = div.style.cssText;
let cssTextSerialization = div.style.cssText;
declarations.forEach(decl => {
test(function(){
assert_true(cssText.indexOf(decl) !== -1, `cssText ('${cssText}') must contain '${decl}'`);
}, `cssText ('${cssText}') must contain '${decl}'`);
assert_true(cssTextSerialization.indexOf(decl) !== -1,
`cssText serialization ('${cssTextSerialization}') must contain contain '${decl}'`);
}, `cssText ('${cssText}') must contain '${decl}' in its serialization`);
});
}
}
Expand Down

0 comments on commit 6e98820

Please sign in to comment.