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 = 'resources/green.jpg'; | 9 var resetImage = 'resources/green.jpg'; |
10 // In this test we load an image then we immediately launch another request | 10 // In this test we load an image then we immediately launch another request |
11 // for the same image - only one load event should be fired. Then we do the | 11 // for the same image - only one load event should be fired. Then we do the |
12 // same again: another load event should be fired. | 12 // same again: another load event should be fired. |
13 img.onload = t.step_func(function() { | 13 img.onload = t.step_func(function() { |
14 img.src = resetImage; | 14 img.src = resetImage; |
15 img.src = testImage; | 15 img.src = testImage; |
16 img.onload = t.step_func_done(); | 16 img.onload = t.step_func_done(); |
17 }); | 17 }); |
18 img.src = resetImage; | 18 img.src = resetImage; |
19 img.src = testImage; | 19 img.src = testImage; |
20 }); | 20 }); |
21 </script> | 21 </script> |
OLD | NEW |