OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>crbug.com/469678: We should fire an image load event even if the image is
the last one we loaded successfully.</title> | 2 <title>crbug.com/469678: We should fire an image load event even if the image is
the last one we loaded successfully.</title> |
3 <script src="../../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
4 <script src="../../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
5 <script> | 5 <script> |
6 async_test(function(t) { | 6 async_test(function(t) { |
7 var img = new Image(); | 7 var img = new Image(); |
8 var testImage = 'resources/green.jpg'; | 8 var testImage = 'resources/green.jpg'; |
9 var resetImage = ''; | 9 var resetImage = ''; |
10 // In this test we load an image. Then we make a null request (img.src='') | 10 // In this test we load an image. Then we make a null request (img.src='') |
11 // which should clear down the image before we attempt to load the same imag
e again. | 11 // which should clear down the image before we attempt to load the same imag
e again. |
12 img.onload = t.step_func(function() { | 12 img.onload = t.step_func(function() { |
13 img.src = resetImage; | 13 img.src = resetImage; |
14 img.src = testImage; | 14 img.src = testImage; |
15 img.onload = t.step_func_done(); | 15 img.onload = t.step_func_done(); |
16 }); | 16 }); |
17 img.src = resetImage; | 17 img.src = resetImage; |
18 img.src = testImage; | 18 img.src = testImage; |
19 }); | 19 }); |
20 </script> | 20 </script> |
OLD | NEW |