Skip to content

Commit

Permalink
[html] Reduce reliance on global state
Browse files Browse the repository at this point in the history
Currently, all tests which invoke the `run_coop_tests` utility function
happen to define a global binding named `tests`. The utility function
has been designed to accept that value as a formal parameter, but its
internal implementation references the global binding instead.

Update the `run_coop_tests` utility function to operate on the input
array.
  • Loading branch information
jugglinmike authored and zcorpan committed Dec 18, 2019
1 parent c1b8d0b commit e0d4dc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion html/cross-origin-opener-policy/resources/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function coop_test(t, host, coop, channelName, hasOpener) {
}

function run_coop_tests(documentCOOPValueTitle, testArray) {
for (const test of tests) {
for (const test of testArray) {
async_test(t => {
coop_test(t, test[0], test[1],
`${documentCOOPValueTitle}_to_${test[0].name}_${test[1].replace(/ /g,"-")}`,
Expand Down

0 comments on commit e0d4dc3

Please sign in to comment.