Update WPT tests for embedded content
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / embedded-content / media-elements / interfaces / HTMLElement / HTMLMediaElement / crossOrigin.html
1 <!doctype html>
2 <title>HTMLMediaElement.crossOrigin</title>
3 <script src=/resources/testharness.js></script>
4 <script src=/resources/testharnessreport.js></script>
5 <div id=log></div>
6 <script>
7 test(function(){
8     var video = document.createElement('video');
9     assert_true('crossOrigin' in video);
10 });
11 test(function(){
12     var video = document.createElement('video');
13     assert_equals(video.crossOrigin, null);
14 }, document.title+', content attribute missing');
15 test(function(){
16     var video = document.createElement('video');
17     video.setAttribute('crossorigin', 'foo');
18     assert_equals(video.crossOrigin, 'anonymous');
19 }, document.title+', content attribute invalid value');
20 test(function(){
21     var video = document.createElement('video');
22     video.setAttribute('crossorigin', '');
23     assert_equals(video.crossOrigin, 'anonymous');
24 }, document.title+', content attribute empty string');
25 test(function(){
26     var video = document.createElement('video');
27     video.setAttribute('crossorigin', 'ANONYMOUS');
28     assert_equals(video.crossOrigin, 'anonymous');
29 }, document.title+', content attribute uppercase ANONYMOUS');
30 test(function(){
31     var video = document.createElement('video');
32     video.setAttribute('crossorigin', 'use-credentials');
33     assert_equals(video.crossOrigin, 'use-credentials');
34 }, document.title+', content attribute use-credentials');
35 test(function(){
36     var video = document.createElement('video');
37     video.crossOrigin = '';
38     assert_equals(video.getAttribute('crossorigin'), '');
39 }, document.title+', setting to empty string');
40 test(function(){
41     var video = document.createElement('video');
42     video.crossOrigin = null;
43     assert_false(video.hasAttribute('crossorigin'));
44 }, document.title+', setting to null');
45 test(function(){
46     var video = document.createElement('video');
47     video.crossOrigin = 'foo';
48     assert_equals(video.getAttribute('crossorigin'), 'foo');
49 }, document.title+', setting to invalid value');
50 test(function(){
51     var video = document.createElement('video');
52     video.crossOrigin = 'ANONYMOUS';
53     assert_equals(video.getAttribute('crossorigin'), 'ANONYMOUS');
54 }, document.title+', setting to uppercase ANONYMOUS');
55 test(function(){
56     var video = document.createElement('video');
57     video.crossOrigin = 'use-credentials';
58     assert_equals(video.getAttribute('crossorigin'), 'use-credentials');
59 }, document.title+', setting to use-credentials');
60 </script>