issue #2823: comment some test codes.

This commit is contained in:
James Chen 2013-10-05 11:24:25 +08:00
parent c381e4ce50
commit d033411bbe
1 changed files with 125 additions and 133 deletions

View File

@ -1938,7 +1938,7 @@ void ScriptingCore::enableDebugger() {
JS_DefineFunction(cx_, debugGlobal_, "_unlockVM", JSBDebug_UnlockExecution, 0, JSPROP_READONLY | JSPROP_PERMANENT); JS_DefineFunction(cx_, debugGlobal_, "_unlockVM", JSBDebug_UnlockExecution, 0, JSPROP_READONLY | JSPROP_PERMANENT);
runScript("jsb_debugger.js", debugGlobal_); runScript("jsb_debugger.js", debugGlobal_);
runScript("SysTest/script.js", debugGlobal_); // runScript("SysTest/script.js", debugGlobal_);
// prepare the debugger // prepare the debugger
jsval argv = OBJECT_TO_JSVAL(global_); jsval argv = OBJECT_TO_JSVAL(global_);
@ -2254,142 +2254,134 @@ static void serverEntryPoint(void)
buf[readBytes] = '\0'; buf[readBytes] = '\0';
TRACE_DEBUGGER_SERVER("debug server : received command >%s", buf); TRACE_DEBUGGER_SERVER("debug server : received command >%s", buf);
if (recieveIndex == 1) // if (recieveIndex == 1)
{ // {
replyToClient(clientSocket, "{ \"from\":\"root\", \"tabs\":[{ \"actor\":\"JSBTabActor\", \"title\":\"Hello cocos2d-x JSB\", \"url\":\"http://www.cocos2d-x.org\" }], \"selected\":0 }"); // replyToClient(clientSocket, "{ \"from\":\"root\", \"tabs\":[{ \"actor\":\"JSBTabActor\", \"title\":\"Hello cocos2d-x JSB\", \"url\":\"http://www.cocos2d-x.org\" }], \"selected\":0 }");
} // }
else if (recieveIndex == 2) // else if (recieveIndex == 2)
{ // {
replyToClient(clientSocket, "{ \"from\":\"JSBTabActor\", \"type\":\"tabAttached\", \"threadActor\":\"tabThreadActor111\" }"); // replyToClient(clientSocket, "{ \"from\":\"JSBTabActor\", \"type\":\"tabAttached\", \"threadActor\":\"tabThreadActor111\" }");
} // }
else if (recieveIndex == 3) // else if (recieveIndex == 3)
{ // {
replyToClient(clientSocket, "{\ // replyToClient(clientSocket, "{\
\"from\": \"tabThreadActor111\",\ // \"from\": \"tabThreadActor111\",\
\"type\": \"paused\",\ // \"type\": \"paused\",\
\"actor\": \"JSBTabActor\",\ // \"actor\": \"JSBTabActor\",\
\"poppedFrames\": [],\ // \"poppedFrames\": [],\
\"why\": {\ // \"why\": {\
\"type\": \"attached\"\ // \"type\": \"attached\"\
}\ // }\
}"); // }");
//
//
//
//replyToClient(clientSocket, "{ \"from\":\"JSBTabActor\", \"type\":\"tabNavigated\", \"state\":\"start\", \"url\":\"my_url.js\" }"); // //replyToClient(clientSocket, "{ \"from\":\"JSBTabActor\", \"type\":\"tabNavigated\", \"state\":\"start\", \"url\":\"my_url.js\" }");
} // }
else if (recieveIndex == 4) // else if (recieveIndex == 4)
{ // {
// replyToClient(clientSocket, "{\"from\": \"tabThreadActor111\",\ // replyToClient(clientSocket, "{\
// \"from\": \"tabThreadActor111\",\
// \"type\": \"newSource\",\ // \"type\": \"newSource\",\
// \"source\": {\ // \"source\": {\
// \"actor\": \"source_actor2\",\ // \"actor\": \"source_actor1\",\
// \"url\": \"http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js\",\ // \"url\": \"file://~/Project/cocos2d-html5/cocos2d/CCDirector.js\",\
// \"isBlackBoxed\": false\ // \"isBlackBoxed\": false\
// }}"); // }\
// }");
replyToClient(clientSocket, "{\ //
\"from\": \"tabThreadActor111\",\ // replyToClient(clientSocket,
\"type\": \"newSource\",\ // "{\
\"source\": {\ // \"sources\": [\
\"actor\": \"source_actor1\",\ // {\
\"url\": \"file://~/Project/cocos2d-html5/cocos2d/CCDirector.js\",\ // \"actor\": \"source_actor1\",\
\"isBlackBoxed\": false\ // \"url\": \"file://~/Project/cocos2d-html5/cocos2d/CCDirector.js\",\
}\ // \"isBlackBoxed\": false\
}"); // }\
// ],\
replyToClient(clientSocket, // \"from\": \"tabThreadActor111\"\
"{\ // }");
\"sources\": [\ // }
{\ // else if (recieveIndex == 5)
\"actor\": \"source_actor1\",\ // {
\"url\": \"file://~/Project/cocos2d-html5/cocos2d/CCDirector.js\",\ // replyToClient(clientSocket, "{\
\"isBlackBoxed\": false\ // \"from\": \"source_actor1\",\
}\ // \"source\": {\
],\ // \"type\": \"longString\",\
\"from\": \"tabThreadActor111\"\ // \"initial\": \"var cc = cc || {}; cc.Director = {};\",\
}"); // \"length\": 100,\
} // \"actor\": \"conn2.longString48\"\
else if (recieveIndex == 5) // }\
{ // }");
replyToClient(clientSocket, "{\ // }
\"from\": \"source_actor1\",\ // else if (recieveIndex == 6)
\"source\": {\ // {
\"type\": \"longString\",\ // replyToClient(clientSocket, "{\
\"initial\": \"var cc = cc || {}; cc.Director = {};\",\ // \"from\": \"conn2.longString48\",\
\"length\": 100,\ // \"substring\": \"var cc = cc || {}; cc.Director = {};\
\"actor\": \"conn2.longString48\"\ //\\ncc.Sprite = {};\"\
}\ // }");
}"); //
} //
else if (recieveIndex == 6) // replyToClient(clientSocket, "{\
{ // \"from\": \"tabThreadActor111\",\
replyToClient(clientSocket, "{\ // \"type\": \"resumed\"\
\"from\": \"conn2.longString48\",\ // }");
\"substring\": \"var cc = cc || {}; cc.Director = {};\ // }
\\ncc.Sprite = {};\"\ // else if (recieveIndex == 7)
}"); // {
// replyToClient(clientSocket, "{\
// \"from\": \"tabThreadActor111\",\
replyToClient(clientSocket, "{\ // \"type\": \"resumed\"\
\"from\": \"tabThreadActor111\",\ // }");
\"type\": \"resumed\"\ // }
}"); // else if (recieveIndex == 8)
} // {
else if (recieveIndex == 7) // replyToClient(clientSocket, "{ \"from\":\"tabThreadActor111\", \"actor\":\"breakActor\"}");//, \"actualLocation\":2 }");
{ // }
replyToClient(clientSocket, "{\ // else if (recieveIndex == 9)
\"from\": \"tabThreadActor111\",\ // {
\"type\": \"resumed\"\ // replyToClient(clientSocket, "{ \"from\":\"breakActor\" }");
}"); // }
} // else if (recieveIndex == 10)
else if (recieveIndex == 8) // {
{ // replyToClient(clientSocket, "{\
replyToClient(clientSocket, "{ \"from\":\"tabThreadActor111\", \"actor\":\"breakActor\"}");//, \"actualLocation\":2 }"); // \"from\": \"tabThreadActor111\",\
} // \"type\": \"resumed\"\
else if (recieveIndex == 9) // }");
{ // }
replyToClient(clientSocket, "{ \"from\":\"breakActor\" }"); // else
} // {
else if (recieveIndex == 10) //
{ //
replyToClient(clientSocket, "{\ // std::string recvBuf = buf;
\"from\": \"tabThreadActor111\",\ // auto found = recvBuf.find("setBreakpoint");
\"type\": \"resumed\"\ // if (found != std::string::npos)
}"); // {
} // replyToClient(clientSocket, "{ \"from\":\"tabThreadActor111\", \"actor\":\"breakActor\"}");//, \"actualLocation\":2 }");
else // }
{ //
// found = recvBuf.find("delete");
// if (found != std::string::npos)
std::string recvBuf = buf; // {
auto found = recvBuf.find("setBreakpoint"); // replyToClient(clientSocket, "{ \"from\":\"breakActor\" }");
if (found != std::string::npos) // }
{ //
replyToClient(clientSocket, "{ \"from\":\"tabThreadActor111\", \"actor\":\"breakActor\"}");//, \"actualLocation\":2 }"); // found = recvBuf.find("interrupt");
} // if (found != std::string::npos)
// {
found = recvBuf.find("delete"); // replyToClient(clientSocket, "{\
if (found != std::string::npos) // \"from\": \"tabThreadActor111\",\
{ // \"type\": \"resumed\"\
replyToClient(clientSocket, "{ \"from\":\"breakActor\" }"); // }");
} // }
//
found = recvBuf.find("interrupt"); // }
if (found != std::string::npos) // ++recieveIndex;
{
replyToClient(clientSocket, "{\
\"from\": \"tabThreadActor111\",\
\"type\": \"resumed\"\
}");
}
}
++recieveIndex;
// no other thread is using this // no other thread is using this
// inData.append(buf); inData.append(buf);
// // process any input, send any output // process any input, send any output
// clearBuffers(); clearBuffers();
} // while(read) } // while(read)
close(clientSocket); close(clientSocket);