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

Side by Side Diff: test/cctest/test-debug.cc

Issue 1213203007: Create a internal, global native context used only for generated code stubs (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Review feedback Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 7323 matching lines...) Expand 10 before | Expand all | Expand 10 after
7334 int CountNativeContexts(); 7334 int CountNativeContexts();
7335 7335
7336 7336
7337 static void NopListener(const v8::Debug::EventDetails& event_details) { 7337 static void NopListener(const v8::Debug::EventDetails& event_details) {
7338 } 7338 }
7339 7339
7340 7340
7341 TEST(DebuggerCreatesContextIffActive) { 7341 TEST(DebuggerCreatesContextIffActive) {
7342 DebugLocalContext env; 7342 DebugLocalContext env;
7343 v8::HandleScope scope(env->GetIsolate()); 7343 v8::HandleScope scope(env->GetIsolate());
7344 CHECK_EQ(1, CountNativeContexts()); 7344 CHECK_EQ(2, CountNativeContexts());
Michael Starzinger 2015/07/10 13:26:30 Same comment as in test-api.cc applies for CountNa
danno 2015/07/13 09:43:37 Done.
7345 7345
7346 v8::Debug::SetDebugEventListener(NULL); 7346 v8::Debug::SetDebugEventListener(NULL);
7347 CompileRun("debugger;"); 7347 CompileRun("debugger;");
7348 CHECK_EQ(1, CountNativeContexts()); 7348 CHECK_EQ(2, CountNativeContexts());
7349 7349
7350 v8::Debug::SetDebugEventListener(NopListener); 7350 v8::Debug::SetDebugEventListener(NopListener);
7351 CompileRun("debugger;"); 7351 CompileRun("debugger;");
7352 CHECK_EQ(2, CountNativeContexts()); 7352 CHECK_EQ(3, CountNativeContexts());
7353 7353
7354 v8::Debug::SetDebugEventListener(NULL); 7354 v8::Debug::SetDebugEventListener(NULL);
7355 } 7355 }
7356 7356
7357 7357
7358 TEST(LiveEditEnabled) { 7358 TEST(LiveEditEnabled) {
7359 v8::internal::FLAG_allow_natives_syntax = true; 7359 v8::internal::FLAG_allow_natives_syntax = true;
7360 LocalContext env; 7360 LocalContext env;
7361 v8::HandleScope scope(env->GetIsolate()); 7361 v8::HandleScope scope(env->GetIsolate());
7362 v8::Debug::SetLiveEditEnabled(env->GetIsolate(), true); 7362 v8::Debug::SetLiveEditEnabled(env->GetIsolate(), true);
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
7630 "let y = 2; \n" 7630 "let y = 2; \n"
7631 "debugger; \n" 7631 "debugger; \n"
7632 "x * y", 7632 "x * y",
7633 30); 7633 30);
7634 ExpectInt32( 7634 ExpectInt32(
7635 "x = 1; y = 2; \n" 7635 "x = 1; y = 2; \n"
7636 "debugger;" 7636 "debugger;"
7637 "x * y", 7637 "x * y",
7638 30); 7638 30);
7639 } 7639 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698