OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <script> | 3 <script> |
4 description("This tests the handling of the script.crossOrigin attribute"); | 4 description("This tests the handling of the script.crossOrigin attribute"); |
5 var script = document.createElement("script"); | 5 var script = document.createElement("script"); |
6 shouldBeTrue("'crossOrigin' in script"); | 6 shouldBeTrue("'crossOrigin' in script"); |
7 shouldBeEqualToString("script.crossOrigin", ""); | 7 shouldBeNull("script.crossOrigin"); |
8 shouldBeEqualToString("script.setAttribute('crossorigin', ''); script.crossOrigi
n", "anonymous"); | 8 shouldBeEqualToString("script.setAttribute('crossorigin', ''); script.crossOrigi
n", "anonymous"); |
9 shouldBeEqualToString("script.removeAttribute('crossorigin'); script.crossOrigin
", ""); | 9 shouldBeNull("script.removeAttribute('crossorigin'); script.crossOrigin"); |
10 shouldBeEqualToString("script.setAttribute('crossorigin', 'foo'); script.crossOr
igin", "anonymous"); | 10 shouldBeEqualToString("script.setAttribute('crossorigin', 'foo'); script.crossOr
igin", "anonymous"); |
11 shouldBeEqualToString("script.setAttribute('crossorigin', 'ANONYMOUS'); script.c
rossOrigin", "anonymous"); | 11 shouldBeEqualToString("script.setAttribute('crossorigin', 'ANONYMOUS'); script.c
rossOrigin", "anonymous"); |
12 shouldBeEqualToString("script.setAttribute('crossorigin', 'use-credentials'); sc
ript.crossOrigin", "use-credentials"); | 12 shouldBeEqualToString("script.setAttribute('crossorigin', 'use-credentials'); sc
ript.crossOrigin", "use-credentials"); |
13 shouldBeEqualToString("script.crossOrigin = ''; script.getAttribute('crossorigin
')", ""); | 13 shouldBeEqualToString("script.crossOrigin = ''; script.getAttribute('crossorigin
')", ""); |
14 shouldBeEqualToString("script.crossOrigin = 'foo'; script.getAttribute('crossori
gin')", "foo"); | 14 shouldBeEqualToString("script.crossOrigin = 'foo'; script.getAttribute('crossori
gin')", "foo"); |
15 shouldBeEqualToString("script.crossOrigin = null; script.getAttribute('crossorig
in')", "null"); | 15 shouldBeFalse("script.crossOrigin = null; script.hasAttribute('crossorigin')"); |
16 shouldBeEqualToString("script.crossOrigin = 'ANONYMOUS'; script.getAttribute('cr
ossorigin')", "ANONYMOUS"); | 16 shouldBeEqualToString("script.crossOrigin = 'ANONYMOUS'; script.getAttribute('cr
ossorigin')", "ANONYMOUS"); |
17 shouldBeEqualToString("script.crossOrigin = 'use-credentials'; script.getAttribu
te('crossorigin')", "use-credentials"); | 17 shouldBeEqualToString("script.crossOrigin = 'use-credentials'; script.getAttribu
te('crossorigin')", "use-credentials"); |
18 </script> | 18 </script> |
OLD | NEW |