Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Side by Side Diff: LayoutTests/fast/dom/Document/document-current-script-async.html

Issue 14852011: Implement document.currentScript (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../js/resources/js-test-pre.js"></script>
3 <script>
4
5 jsTestIsAsync = true;
6
7 description('Test usage of document.currentScript with async')
8
9 var seenIds = [];
10
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);
16
17 seenIds.push(document.currentScript.id);
18 seenIds.sort();
19 if (seenIds.join('') === expectedIds)
20 finishJSTest();
21 }
22
23 var expectedIds = 'abcdef';
24
25 </script>
26 <script id="a">
27 logCurrentScript('a');
28 </script>
29 <script id="b" async src="resources/log-current-script-b.js"></script>
30 <script id="c">
31 logCurrentScript('c');
32 </script>
33 <script id="d" async src="resources/log-current-script-d.js"></script>
34
35 <script id="e">
36 logCurrentScript('e');
37
38 var script = document.createElement('script');
39 script.id = 'f'
40 script.async = true;
41 script.defer = false;
42 script.src = 'resources/log-current-script-f.js';
43 document.head.appendChild(script);
44 </script>
45
46 <script src="../../js/resources/js-test-post.js"></script>
47 </body>
48 </html>
49
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698