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

Side by Side Diff: LayoutTests/imported/web-platform-tests/html/semantics/embedded-content/the-img-element/srcset/common.js

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 setup({explicit_done:true});
2
3 function check(img) {
4 var name = format_value(img.getAttribute('srcset'));
5 if (img.hasAttribute('sizes')) {
6 name += ' sizes=' + format_value(img.getAttribute('sizes'));
7 }
8 if (img.hasAttribute('data-desc')) {
9 name += ' (' + img.getAttribute('data-desc') + ')';
10 }
11 test(function() {
12 var expect = img.dataset.expect;
13 if ('resolve' in img.dataset) {
14 var a = document.createElement('a');
15 a.href = expect;
16 expect = a.href;
17 }
18 assert_equals(img.currentSrc, expect);
19 }, name);
20 }
21
22 onload = function() {
23 [].forEach.call(document.images, check);
24 done();
25 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698