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

Unified Diff: LayoutTests/http/tests/eventsource/eventsource-events-after-close.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-events-after-close.html
diff --git a/LayoutTests/http/tests/eventsource/eventsource-events-after-close.html b/LayoutTests/http/tests/eventsource/eventsource-events-after-close.html
index 6f9fd3f0467125922c4f9f1013bce4e0247e2f51..136e4b88e4b6292e4c01782eecbae130f928db33 100644
--- a/LayoutTests/http/tests/eventsource/eventsource-events-after-close.html
+++ b/LayoutTests/http/tests/eventsource/eventsource-events-after-close.html
@@ -1,34 +1,3 @@
-<!DOCTYPE html>
-<p>
- Test that no more message events are fired after EventSource.close() is called, even if it
- means discarding events that were already processed.
- Passes if only one message is received.
-</p>
-<pre id=log></pre>
-<script>
- if (window.testRunner) {
- testRunner.dumpAsText();
- testRunner.waitUntilDone();
- }
-
- var log = document.getElementById("log");
- var es = new EventSource("resources/event-stream.php");
- var counter = 0;
- es.addEventListener('message', function (e) {
- log.innerHTML += "Got message #" + ++counter + "\n";
-
- if (counter > 1)
- log.innerHTML += "FAIL. Handler called after the source was closed explicitely.\n";
-
- es.close();
-
- setTimeout(function () {
- // Need to wait to see if we're called again.
- // event-stream.php sends a bunch of events before flushing, so if close() didn't take
- // effect we'd get a second message practically instantaneously, waiting 100ms should be ok.
- if (window.testRunner)
- testRunner.notifyDone();
- }, 100);
- }, false);
-
-</script>
+<!DOCTYPE HTML>
+<script src="/js-test-resources/js-test.js"></script>
+<script src="script-tests/eventsource-events-after-close.js"></script>

Powered by Google App Engine
This is Rietveld 408576698