Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/plugins/object-onerror-placeholder.html |
| diff --git a/third_party/WebKit/LayoutTests/plugins/object-onerror-placeholder.html b/third_party/WebKit/LayoutTests/plugins/object-onerror-placeholder.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a87aea111090d97efaad0cf9f25ed4d876bbbe61 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/plugins/object-onerror-placeholder.html |
| @@ -0,0 +1,27 @@ |
| +<html> |
| +<script src="../resources/testharness.js"></script> |
| +<script src="../resources/testharnessreport.js"></script> |
| +<body> |
| +<object type="image/test" data="hello" id="object1" onerror="errorHandler()"> |
| +<object type="image/gif" data="resources/apple.gif" id="objectimage" |
| +style="display:none" ></object> |
|
Bernhard Bauer
2017/04/09 20:32:24
This is formatted pretty badly. Please familiarize
George Joseph
2017/04/13 11:30:48
Done.
|
| +<script> |
| +var gotErrorEvent=false; |
| +var testobject = async_test("crbug.com/445557:error events aren't dispatched" + |
| + " for <object> elements"); |
| +function errorHandler() { |
| + document.getElementById("objectimage").onerror = imageErrorHandler; |
|
Bernhard Bauer
2017/04/09 20:32:24
I don't think you need to chain these two tests to
George Joseph
2017/04/13 11:30:48
Done.
Second test added.
|
| + document.getElementById("objectimage").style.display="inline"; |
| + testobject.step_timeout(function() { |
|
Bernhard Bauer
2017/04/09 20:32:24
Using timeouts isn't ideal (sometimes tests can le
George Joseph
2017/04/13 11:30:48
Done.
Please note that though the load event is be
|
| + if(gotErrorEvent != false) |
| + assert_false( gotErrorEvent , " Load Event Fired"); |
|
Bernhard Bauer
2017/04/09 20:32:24
This could just be assert(!gotErrorEvent), no?
George Joseph
2017/04/13 11:30:48
Done. Code Removed.
|
| + else |
| + testobject.done(); |
| + },3000); |
| +}; |
| +function imageErrorHandler() { |
| + gotErrorEvent=true; |
| +} |
| +</script> |
| +</body> |
| +</html> |