2 <script src=
"../../../resources/js-test.js"></script>
7 description('Test usage of document.currentScript with async')
11 function logCurrentScript(id
) {
12 // Don't print anything if pass since the execution order of script[async]
13 // is non deterministic.
14 if (id
!== document
.currentScript
.id
)
15 shouldBeEqualToString('document.currentScript.id', id
);
17 seenIds
.push(document
.currentScript
.id
);
19 if (seenIds
.join('') === expectedIds
)
23 var expectedIds
= 'abcdef';
27 logCurrentScript('a');
29 <script id=
"b" async
src=
"resources/log-current-script-b.js"></script>
31 logCurrentScript('c');
33 <script id=
"d" async
src=
"resources/log-current-script-d.js"></script>
36 logCurrentScript('e');
38 var script = document.createElement('script');
42 script.src = 'resources/log-current-script-f.js';
43 document.head.appendChild(script);