aboutsummaryrefslogtreecommitdiffstats
path: root/signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js
diff options
context:
space:
mode:
Diffstat (limited to 'signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js')
-rw-r--r--signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js
new file mode 100644
index 0000000..cd4e174
--- /dev/null
+++ b/signaling-server/node_modules/socket.io/node_modules/socket.io-client/node_modules/xmlhttprequest/tests/test-request-protocols.js
@@ -0,0 +1,34 @@
+var sys = require("util")
+ , assert = require("assert")
+ , XMLHttpRequest = require("../lib/XMLHttpRequest").XMLHttpRequest
+ , xhr;
+
+xhr = new XMLHttpRequest();
+
+xhr.onreadystatechange = function() {
+ if (this.readyState == 4) {
+ assert.equal("Hello World", this.responseText);
+ this.close();
+ runSync();
+ }
+};
+
+// Async
+var url = "file://" + __dirname + "/testdata.txt";
+xhr.open("GET", url);
+xhr.send();
+
+// Sync
+var runSync = function() {
+ xhr = new XMLHttpRequest();
+
+ xhr.onreadystatechange = function() {
+ if (this.readyState == 4) {
+ assert.equal("Hello World", this.responseText);
+ this.close();
+ sys.puts("done");
+ }
+ };
+ xhr.open("GET", url, false);
+ xhr.send();
+}