Commit 589ce756 authored by yangguo@chromium.org's avatar yangguo@chromium.org

Fixing test case from r9469.

Review URL: http://codereview.chromium.org/8038046

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9473 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 9bc30dfe
...@@ -5845,14 +5845,11 @@ TEST(DebuggerAgent) { ...@@ -5845,14 +5845,11 @@ TEST(DebuggerAgent) {
const int kPort1 = 5858; const int kPort1 = 5858;
const int kPort2 = 5857; const int kPort2 = 5857;
const int kPort3 = 5856; const int kPort3 = 5856;
const int kPort4 = 5855;
// Make a string with the port2 number. // Make a string with the port2 number.
const int kPortBufferLen = 6; const int kPortBufferLen = 6;
char port2_str[kPortBufferLen]; char port2_str[kPortBufferLen];
OS::SNPrintF(i::Vector<char>(port2_str, kPortBufferLen), "%d", kPort2); OS::SNPrintF(i::Vector<char>(port2_str, kPortBufferLen), "%d", kPort2);
char port4_str[kPortBufferLen];
OS::SNPrintF(i::Vector<char>(port4_str, kPortBufferLen), "%d", kPort4);
bool ok; bool ok;
...@@ -5888,27 +5885,6 @@ TEST(DebuggerAgent) { ...@@ -5888,27 +5885,6 @@ TEST(DebuggerAgent) {
debugger->StopAgent(); debugger->StopAgent();
delete server; delete server;
// Test responsiveness after connecting and disconnecting a client.
ok = debugger->StartAgent("test", kPort4);
CHECK(ok);
client = i::OS::CreateSocket();
ok = client->Connect("localhost", port4_str);
CHECK(ok);
ok = client->Receive(&buf, 1) == 1;
CHECK(ok);
ok = client->Send(
"{\"seq\":1,\"type\":\"request\",\"command\":\"disconnect\"}", 49);
CHECK(ok);
client->Shutdown();
delete client;
// Is the server still responsive?
client = i::OS::CreateSocket();
ok = client->Connect("localhost", port4_str);
CHECK(ok);
client->Shutdown();
delete client;
debugger->StopAgent();
} }
......
...@@ -63,7 +63,7 @@ enum Turn { ...@@ -63,7 +63,7 @@ enum Turn {
static Turn turn = FILL_CACHE; static Turn turn = FILL_CACHE;
class ThreadA: public v8::internal::Thread { class ThreadA : public v8::internal::Thread {
public: public:
ThreadA() : Thread("ThreadA") { } ThreadA() : Thread("ThreadA") { }
void Run() { void Run() {
...@@ -99,7 +99,7 @@ class ThreadA: public v8::internal::Thread { ...@@ -99,7 +99,7 @@ class ThreadA: public v8::internal::Thread {
}; };
class ThreadB: public v8::internal::Thread { class ThreadB : public v8::internal::Thread {
public: public:
ThreadB() : Thread("ThreadB") { } ThreadB() : Thread("ThreadB") { }
void Run() { void Run() {
...@@ -190,3 +190,19 @@ TEST(ThreadIdValidation) { ...@@ -190,3 +190,19 @@ TEST(ThreadIdValidation) {
delete threads[i]; delete threads[i];
} }
} }
class ThreadC : public v8::internal::Thread {
public:
ThreadC() : Thread("ThreadC") { }
void Run() {
Join();
}
};
TEST(ThreadJoinSelf) {
ThreadC thread;
thread.Start();
thread.Join();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment