Index: LayoutTests/http/tests/eventsource/script-tests/eventsource-retry-precision.js |
diff --git a/LayoutTests/http/tests/eventsource/script-tests/eventsource-retry-precision.js b/LayoutTests/http/tests/eventsource/script-tests/eventsource-retry-precision.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e4dbb99993cfc496410189d289ecb641e1de51fc |
--- /dev/null |
+++ b/LayoutTests/http/tests/eventsource/script-tests/eventsource-retry-precision.js |
@@ -0,0 +1,27 @@ |
+if (self.importScripts) |
+ importScripts("/js-test-resources/js-test.js"); |
+ |
+description("Test EventSource retry time precision."); |
+ |
+self.jsTestIsAsync = true; |
+ |
+var timeoutId = setTimeout(function () { |
+ testPassed("did not immediately reconnect"); |
+ end(); |
+}, 500); |
+ |
+var count = 0; |
+var es = new EventSource("resources/precise-retry.asis"); |
+es.onopen = function () { |
+ if (count++ != 2) |
+ return; |
+ clearTimeout(timeoutId); |
+ testFailed("reconnected too soon"); |
+ end(); |
+}; |
+ |
+function end() { |
+ es.close(); |
+ debug("DONE"); |
+ finishJSTest(); |
+} |