Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: LayoutTests/http/tests/eventsource/eventsource-eof.html

Issue 347043002: Rework EventSource tests for better Worker test coverage. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Move out CORS tests Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698