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

Side by Side Diff: LayoutTests/http/tests/images/image-currentsrc.html

Issue 317723003: Split image-currentsrc test into 3 separate tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/images/image-currentsrc-error.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="/js-test-resources/js-test.js"></script>
3 <body>
4 <script>
5 document.body.innerHTML += '<img id="load" src="http://127.0.0.1:8000/resour ces/slow-image.php?name=square100.png&mimeType=image/png&sleep=100">';
6 document.body.innerHTML += '<img id="error" srcset="http://127.0.0.1:8000/re sources/slow-image.php?name=not_there.png&mimeType=image/png&sleep=300">';
7 document.body.innerHTML += '<img id="redirect" src="http://127.0.0.1:8000/re sources/slow-image.php?redirect_name=square100.png&mimeType=image/png&sleep=500" >';
8 jsTestIsAsync = true;
9 var img = window.document.getElementById("load");
10 shouldBe('img.currentSrc', '""');
11 var expectedCurrentSrc = "http://127.0.0.1:8000/resources/slow-image.php?nam e=square100.png&mimeType=image/png&sleep=100";
12 img.onload = function() {
13 img.srcset = "http://127.0.0.1:8000/resources/slow-image.php?name=square 200.png&mimeType=image/png&sleep=100 1x";
14 shouldBe('img.currentSrc', 'expectedCurrentSrc');
15 expectedCurrentSrc = "http://127.0.0.1:8000/resources/slow-image.php?nam e=square200.png&mimeType=image/png&sleep=100";
16 };
17 var img_err = window.document.getElementById("error");
18 img_err.onerror = function() {
19 shouldBe('img_err.currentSrc', '"http://127.0.0.1:8000/resources/slow-im age.php?name=not_there.png&mimeType=image/png&sleep=300"');
20 };
21
22 var img_redirect = window.document.getElementById("redirect");
23 img_redirect.onload = function() {
24 shouldBe('img_redirect.currentSrc', '"http://127.0.0.1:8000/resources/sl ow-image.php?redirect_name=square100.png&mimeType=image/png&sleep=500"');
25 };
26 window.onload = function() {
27 finishJSTest();
28 };
29 </script>
30 </body>
OLDNEW
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/http/tests/images/image-currentsrc-error.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698