Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(619)

Unified Diff: test/cctest/test-debug.cc

Issue 42686: Fix issue 96, test-debug/ThreadedDebugging is flaky... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-debug.cc
===================================================================
--- test/cctest/test-debug.cc (revision 1660)
+++ test/cctest/test-debug.cc (working copy)
@@ -3300,6 +3300,12 @@
};
+static v8::Handle<v8::Value> ThreadedSetBarrier1(const v8::Arguments& args) {
+ threaded_debugging_barriers.barrier_1.Wait();
+ return v8::Undefined();
+}
+
+
static void ThreadedMessageHandler(const uint16_t* message, int length,
void *data) {
static char print_buffer[1000];
@@ -3313,7 +3319,7 @@
void V8Thread::Run() {
- const char* source_1 =
+ const char* source =
"flag = true;\n"
"function bar( new_value ) {\n"
" flag = new_value;\n"
@@ -3323,19 +3329,25 @@
"function foo() {\n"
" var x = 1;\n"
" while ( flag == true ) {\n"
+ " if ( x == 1 ) {\n"
+ " ThreadedSetBarrier1();\n"
+ " }\n"
" x = x + 1;\n"
" }\n"
"}\n"
- "\n";
- const char* source_2 = "foo();\n";
+ "\n"
+ "foo();\n";
v8::HandleScope scope;
DebugLocalContext env;
v8::Debug::SetMessageHandler(&ThreadedMessageHandler);
+ v8::Handle<v8::ObjectTemplate> global_template = v8::ObjectTemplate::New();
+ global_template->Set(v8::String::New("ThreadedSetBarrier1"),
+ v8::FunctionTemplate::New(ThreadedSetBarrier1));
+ v8::Handle<v8::Context> context = v8::Context::New(NULL, global_template);
+ v8::Context::Scope context_scope(context);
- CompileRun(source_1);
- threaded_debugging_barriers.barrier_1.Wait();
- CompileRun(source_2);
+ CompileRun(source);
}
void DebuggerThread::Run() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698