Index: third_party/WebKit/LayoutTests/fast/events/onload-body-replace.html |
diff --git a/third_party/WebKit/LayoutTests/fast/events/onload-body-replace.html b/third_party/WebKit/LayoutTests/fast/events/onload-body-replace.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..156e5a99e10e3e37471c0c7af60790a806fb22ee |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/events/onload-body-replace.html |
@@ -0,0 +1,28 @@ |
+<!doctype html> |
+<html> |
+<head> |
+<script> |
+if (window.testRunner) |
+ testRunner.dumpAsText(); |
+ |
+function windowHandler() { |
+ var result = document.getElementById('result'); |
+ result.innerHTML='FAIL: window.onload event handler did run.'; |
+} |
+ |
+function bodyHandler() { |
+ var result = document.getElementById('result'); |
+ if (result.textContent.startsWith('PASS:')) |
+ result.textContent += ", but the document body onload did."; |
+} |
+ |
+window.onload = windowHandler; |
+</script> |
+</head> |
+<body onload="bodyHandler()"> |
+This tests that a <body> onload handler clears and replaces the attribute listener on the window. |
+You should see "PASS" below. |
+ |
+<div id='result'>PASS: window.onload event handler did not run<div> |
+</body> |
+</html> |