fixed test crossdomains support
authorGopal Raghavan <gopal.raghavan@nokia.com>
Thu, 01 Nov 2012 05:42:22 -0400
changeset 78 d5e5053b280c
parent 77 9937fec92aab
child 79 66dd77e95c2f
fixed test crossdomains support
tests/cors/submitted/cors1.0/support.js
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/cors/submitted/cors1.0/support.js	Thu Nov 01 05:42:22 2012 -0400
@@ -0,0 +1,26 @@
+// For ignoring exception names (just for testing)
+/*
+_real_assert_throws = assert_throws;
+function assert_throws(d, func, desc) {
+    try {
+        func();
+    } catch(e) {
+        return true;
+    }
+    assert_unreached("Didn't throw!");
+}
+*/
+
+function dirname(path) {
+    return path.replace(/\/[^\/]*$/, '/')
+}
+
+/* This subdomain should point to this same location */
+var SUBDOMAIN = 'www1'
+var SUBDOMAIN2 = 'www2'
+var PORT = "81"
+var PORTS = "83"
+
+/* Changes http://example.com/abc/def/cool.htm to http://www1.example.com/abc/def/ */
+var CROSSDOMAIN = dirname(location.href)
+    .replace('://', '://' + SUBDOMAIN + '.')