OLD | NEW |
1 // Copyright 2007-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2007-2008 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 3123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3134 } | 3134 } |
3135 | 3135 |
3136 f->Call(env->Global(), 0, NULL); | 3136 f->Call(env->Global(), 0, NULL); |
3137 CHECK_EQ(2, break_point_hit_count); | 3137 CHECK_EQ(2, break_point_hit_count); |
3138 | 3138 |
3139 // Get rid of the debug event listener. | 3139 // Get rid of the debug event listener. |
3140 v8::Debug::SetDebugEventListener(NULL); | 3140 v8::Debug::SetDebugEventListener(NULL); |
3141 CheckDebuggerUnloaded(); | 3141 CheckDebuggerUnloaded(); |
3142 } | 3142 } |
3143 | 3143 |
| 3144 static const char* kSimpleExtensionSource = |
| 3145 "(function Foo() {" |
| 3146 " return 4;" |
| 3147 "})() "; |
| 3148 |
| 3149 // http://crbug.com/28933 |
| 3150 // Test that debug break is disabled when bootstrapper is active. |
| 3151 TEST(NoBreakWhenBootstrapping) { |
| 3152 v8::HandleScope scope; |
| 3153 |
| 3154 // Register a debug event listener which sets the break flag and counts. |
| 3155 v8::Debug::SetDebugEventListener(DebugEventCounter); |
| 3156 |
| 3157 // Set the debug break flag. |
| 3158 v8::Debug::DebugBreak(); |
| 3159 break_point_hit_count = 0; |
| 3160 { |
| 3161 // Create a context with an extension to make sure that some JavaScript |
| 3162 // code is executed during bootstrapping. |
| 3163 v8::RegisterExtension(new v8::Extension("simpletest", |
| 3164 kSimpleExtensionSource)); |
| 3165 const char* extension_names[] = { "simpletest" }; |
| 3166 v8::ExtensionConfiguration extensions(1, extension_names); |
| 3167 v8::Persistent<v8::Context> context = v8::Context::New(&extensions); |
| 3168 context.Dispose(); |
| 3169 } |
| 3170 // Check that no DebugBreak events occured during the context creation. |
| 3171 CHECK_EQ(0, break_point_hit_count); |
| 3172 |
| 3173 // Get rid of the debug event listener. |
| 3174 v8::Debug::SetDebugEventListener(NULL); |
| 3175 CheckDebuggerUnloaded(); |
| 3176 } |
3144 | 3177 |
3145 static v8::Handle<v8::Array> NamedEnum(const v8::AccessorInfo&) { | 3178 static v8::Handle<v8::Array> NamedEnum(const v8::AccessorInfo&) { |
3146 v8::Handle<v8::Array> result = v8::Array::New(3); | 3179 v8::Handle<v8::Array> result = v8::Array::New(3); |
3147 result->Set(v8::Integer::New(0), v8::String::New("a")); | 3180 result->Set(v8::Integer::New(0), v8::String::New("a")); |
3148 result->Set(v8::Integer::New(1), v8::String::New("b")); | 3181 result->Set(v8::Integer::New(1), v8::String::New("b")); |
3149 result->Set(v8::Integer::New(2), v8::String::New("c")); | 3182 result->Set(v8::Integer::New(2), v8::String::New("c")); |
3150 return result; | 3183 return result; |
3151 } | 3184 } |
3152 | 3185 |
3153 | 3186 |
(...skipping 2592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5746 | 5779 |
5747 break_point_hit_count = 0; | 5780 break_point_hit_count = 0; |
5748 foo->Call(env->Global(), 0, NULL); | 5781 foo->Call(env->Global(), 0, NULL); |
5749 CHECK_EQ(1, break_point_hit_count); | 5782 CHECK_EQ(1, break_point_hit_count); |
5750 | 5783 |
5751 v8::Debug::SetDebugEventListener(NULL); | 5784 v8::Debug::SetDebugEventListener(NULL); |
5752 debugee_context = v8::Handle<v8::Context>(); | 5785 debugee_context = v8::Handle<v8::Context>(); |
5753 debugger_context = v8::Handle<v8::Context>(); | 5786 debugger_context = v8::Handle<v8::Context>(); |
5754 CheckDebuggerUnloaded(); | 5787 CheckDebuggerUnloaded(); |
5755 } | 5788 } |
OLD | NEW |