Merge pull request #12403 from VisualSJ/v3-aa

[ci skip]Fixed some bug
This commit is contained in:
pandamicro 2015-06-18 12:31:27 +08:00
commit 9dc52ba72f
2 changed files with 8 additions and 5 deletions

View File

@ -53,7 +53,7 @@ var UIVideoPlayerTest = UIScene.extend({
video.resume();
}},
{ name: "SEEKTO", func: function(){
var sec = ((Math.random() * 3) * 100 | 0) / 100;
var sec = ((Math.random() * 59) * 100 | 0) / 100;
cc.log("seekTo %f sec!", sec);
video.seekTo(sec);
}},

View File

@ -104,10 +104,13 @@ var XHRTestLayer = cc.Layer.extend({
// 5 seconds for timeout
xhr.timeout = 5000;
xhr.setRequestHeader("Accept-Encoding","gzip,deflate");
//set arguments with <URL>?xxx=xxx&yyy=yyy
xhr.open("GET", "http://geek.csdn.net/news/detail/33683", true);
if(cc.sys.isNative){
xhr.open("GET", "http://geek.csdn.net/news/detail/33683", true);
}else{
xhr.open("GET", "http://httpbin.org/get?show_env=1", true);
}
xhr.setRequestHeader("Accept-Encoding","gzip,deflate");
xhr.send();
},
@ -127,7 +130,7 @@ var XHRTestLayer = cc.Layer.extend({
ensureLeftAligned(responseLabel);
responseLabel.x = winSize.width / 10 * 3;
responseLabel.y = winSize.height / 2;
var xhr = cc.loader.getXMLHttpRequest();
streamXHREventsToLabel(xhr, statusPostLabel, responseLabel, "POST");