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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/media-elements/location-of-the-media-resource/currentSrc.html

Issue 1144143009: W3C Test: Import web-platform-tests/html/semantics (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 <title>currentSrc</title>
3 <script src="../../../../../../../resources/testharness.js"></script>
4 <script src="../../../../../../../resources/testharnessreport.js"></script>
5 <div id="log"></div>
6 <script>
7 ['audio', 'video'].forEach(function(tagName) {
8 test(function() {
9 assert_equals(document.createElement(tagName).currentSrc, '');
10 }, tagName + '.currentSrc initial value');
11
12 ['', '.', ' ', 'data:,'].forEach(function(src) {
13 async_test(function(t) {
14 var e = document.createElement(tagName);
15 e.src = src;
16 assert_equals(e.currentSrc, '');
17 setTimeout(t.step_func(function() {
18 if (src == '') {
19 assert_equals(e.currentSrc, '');
20 } else {
21 assert_equals(e.currentSrc, e.src);
22 }
23 t.done();
24 }), 0);
25 }, tagName + '.currentSrc after setting src attribute "' + src + '"');
26
27 async_test(function(t) {
28 var e = document.createElement(tagName);
29 var s = document.createElement('source');
30 s.src = src;
31 e.appendChild(s);
32 assert_equals(e.currentSrc, '');
33 setTimeout(t.step_func(function() {
34 if (src == '') {
35 assert_equals(e.currentSrc, '');
36 } else {
37 assert_equals(e.currentSrc, s.src);
38 }
39 t.done();
40 }), 0);
41 }, tagName + '.currentSrc after adding source element with src attribute "' + src + '"');
42 });
43 });
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698