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

Side by Side Diff: LayoutTests/http/tests/eventsource/eventsource-retry-precision.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 unified diff | Download patch
OLDNEW
1 <html> 1 <!DOCTYPE HTML>
2 <body> 2 <script src="/js-test-resources/js-test.js"></script>
3 <p>Test EventSource retry time precision. Should print PASS followed by DONE.</p > 3 <script src="script-tests/eventsource-retry-precision.js"></script>
4 <script>
5 function log(msg) {
6 document.body.innerHTML += msg + "<br>";
7 }
8
9 if (window.testRunner) {
10 testRunner.dumpAsText();
11 testRunner.waitUntilDone();
12 }
13
14 var timeoutId = setTimeout(function () {
15 log("PASS: did not immediately reconnect");
16 end();
17 }, 500);
18
19 var count = 0;
20 var es = new EventSource("resources/precise-retry.asis");
21 es.onopen = function () {
22 if (count++ != 2)
23 return;
24 clearTimeout(timeoutId);
25 log("FAIL: reconnected too soon");
26 end();
27 };
28
29 function end() {
30 es.close();
31 log("DONE");
32 if (window.testRunner)
33 testRunner.notifyDone();
34 }
35 </script>
36 </body>
37 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698