|
@@ -3,39 +3,33 @@ package unit;
|
|
import utest.Async;
|
|
import utest.Async;
|
|
|
|
|
|
class TestHttp extends Test {
|
|
class TestHttp extends Test {
|
|
|
|
+ #if flash
|
|
public function setupClass() {
|
|
public function setupClass() {
|
|
- #if flash
|
|
|
|
flash.system.Security.allowDomain("*");
|
|
flash.system.Security.allowDomain("*");
|
|
flash.system.Security.allowInsecureDomain("*");
|
|
flash.system.Security.allowInsecureDomain("*");
|
|
flash.system.Security.loadPolicyFile("http://localhost:20200/crossdomain.xml");
|
|
flash.system.Security.loadPolicyFile("http://localhost:20200/crossdomain.xml");
|
|
- #end
|
|
|
|
}
|
|
}
|
|
|
|
+ #end
|
|
|
|
|
|
- function run(async:Async, test:()->Void) {
|
|
|
|
- // { comment this out to run http tests locally
|
|
|
|
- #if (!github || (github && js && !nodejs)) //also don't run on sauce labs
|
|
|
|
- noAssert();
|
|
|
|
- async.done();
|
|
|
|
- return;
|
|
|
|
- #end
|
|
|
|
- // }
|
|
|
|
|
|
+ static final RUN_HTTP_TESTS =
|
|
|
|
+ #if !github false && #end // comment out line to run http tests locally
|
|
|
|
+ #if (github && (java || flash || (cs && Windows)))
|
|
|
|
+ false
|
|
|
|
+ #elseif (js && !nodejs)
|
|
|
|
+ js.Browser.supported
|
|
|
|
+ #else
|
|
|
|
+ true
|
|
|
|
+ #end;
|
|
|
|
|
|
- #if (js && !nodejs)
|
|
|
|
- if(!js.Browser.supported) {
|
|
|
|
- noAssert();
|
|
|
|
- async.done();
|
|
|
|
|
|
+ function run(async:Async, test:()->Void) {
|
|
|
|
+ if (RUN_HTTP_TESTS) {
|
|
|
|
+ test();
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
- test();
|
|
|
|
- #elseif (github && (hl || java || (flash && (Linux || Mac || Windows)) || (cs && Windows)))
|
|
|
|
noAssert();
|
|
noAssert();
|
|
async.done();
|
|
async.done();
|
|
- return;
|
|
|
|
- #else
|
|
|
|
- test();
|
|
|
|
- #end
|
|
|
|
}
|
|
}
|
|
-#if !(github && hl)
|
|
|
|
|
|
+
|
|
@:timeout(1000)
|
|
@:timeout(1000)
|
|
public function testPostData(async:Async) run(async, () -> {
|
|
public function testPostData(async:Async) run(async, () -> {
|
|
var srcStr = 'hello, world';
|
|
var srcStr = 'hello, world';
|
|
@@ -84,5 +78,4 @@ class TestHttp extends Test {
|
|
d.setPostBytes(srcData);
|
|
d.setPostBytes(srcData);
|
|
d.request();
|
|
d.request();
|
|
});
|
|
});
|
|
-#end
|
|
|
|
}
|
|
}
|