Index: LayoutTests/http/tests/eventsource/eventsource-eof.html |
diff --git a/LayoutTests/http/tests/eventsource/eventsource-eof.html b/LayoutTests/http/tests/eventsource/eventsource-eof.html |
index 52c33cafb640fde20fcda6c71ce0bf18440203f8..419b1fd3deef366562210c8078350fb9d55ca38d 100644 |
--- a/LayoutTests/http/tests/eventsource/eventsource-eof.html |
+++ b/LayoutTests/http/tests/eventsource/eventsource-eof.html |
@@ -1,48 +1,4 @@ |
-<html> |
-<body> |
-<p>Test that EventSource discards event data if there is no newline before eof. Should print a series of PASS messages followed by DONE.</p> |
-<div id="result"></div> |
-<script> |
-function log(msg) { |
- document.getElementById("result").innerHTML += msg + "<br>"; |
-} |
- |
-if (window.testRunner) { |
- testRunner.dumpAsText(); |
- testRunner.waitUntilDone(); |
-} |
- |
-var count = 1; |
- |
-var es = new EventSource("resources/es-eof.php"); |
- |
-es.onerror = function () { |
- if (count++ == 3) { |
- es.close(); |
- if (window.testRunner) |
- testRunner.notifyDone(); |
- } |
-}; |
- |
-es.onmessage = function (evt) { |
- if (evt.data == ("DATA" + count)) { |
- if (evt.lastEventId == count) { |
- if (evt.type == "message") |
- log("PASS: got event with expected data, lastEventId, and type"); |
- else |
- log("FAIL: got expected data and lastEventId but type is wrong"); |
- } |
- else if (evt.type == "message") |
- log("FAIL: got expected data but lastEventId is wrong"); |
- else |
- log("FAIL: got expected data but lastEventId and type are wrong"); |
- } |
- else if (count == 3 && evt.data == "DATA" && evt.lastEventId == "3.1" && evt.type == "msg") |
- log("DONE"); |
- else |
- log("FAIL: got unexpected message event"); |
-}; |
-es.addEventListener("msg", es.onmessage); |
+<!DOCTYPE HTML> |
+<script src="/js-test-resources/js-test.js"></script> |
+<script src="script-tests/eventsource-eof.js"> |
</script> |
-</body> |
-</html> |