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

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

Issue 43130: Fix the handling of line offset when getting the source line from a ScriptMirror (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/mirror-delay.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3702 matching lines...) Expand 10 before | Expand all | Expand 10 after
3713 " CheckSourceLine(1)\n" 3713 " CheckSourceLine(1)\n"
3714 " CheckSourceLine(2)\n" 3714 " CheckSourceLine(2)\n"
3715 " CheckSourceLine(3)\n" 3715 " CheckSourceLine(3)\n"
3716 "}; f()"))->Run(); 3716 "}; f()"))->Run();
3717 3717
3718 // Test that a parameter can be passed to a function called in the debugger. 3718 // Test that a parameter can be passed to a function called in the debugger.
3719 v8::Script::Compile(v8::String::New("CheckDataParameter()"))->Run(); 3719 v8::Script::Compile(v8::String::New("CheckDataParameter()"))->Run();
3720 3720
3721 // Test that a function with closure can be run in the debugger. 3721 // Test that a function with closure can be run in the debugger.
3722 v8::Script::Compile(v8::String::New("CheckClosure()"))->Run(); 3722 v8::Script::Compile(v8::String::New("CheckClosure()"))->Run();
3723
3724
3725 // Test that the source line is correct when there is a line offset.
3726 v8::ScriptOrigin origin(v8::String::New("test"),
3727 v8::Integer::New(7));
3728 v8::Script::Compile(v8::String::New("CheckSourceLine(7)"), &origin)->Run();
3729 v8::Script::Compile(v8::String::New("function f() {\n"
3730 " CheckSourceLine(8)\n"
3731 " CheckSourceLine(9)\n"
3732 " CheckSourceLine(10)\n"
3733 "}; f()"), &origin)->Run();
3723 } 3734 }
3724 3735
3725 3736
3726 // Test that clearing the debug event listener actually clears all break points 3737 // Test that clearing the debug event listener actually clears all break points
3727 // and related information. 3738 // and related information.
3728 TEST(DebuggerUnload) { 3739 TEST(DebuggerUnload) {
3729 v8::HandleScope scope; 3740 v8::HandleScope scope;
3730 DebugLocalContext env; 3741 DebugLocalContext env;
3731 3742
3732 // Check debugger is unloaded before it is used. 3743 // Check debugger is unloaded before it is used.
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
3808 3819
3809 // Fill a host dispatch and a continue command on the command queue before 3820 // Fill a host dispatch and a continue command on the command queue before
3810 // generating a debug break. 3821 // generating a debug break.
3811 v8::Debug::SendHostDispatch(NULL); 3822 v8::Debug::SendHostDispatch(NULL);
3812 v8::Debug::SendCommand(buffer, AsciiToUtf16(command_continue, buffer)); 3823 v8::Debug::SendCommand(buffer, AsciiToUtf16(command_continue, buffer));
3813 CompileRun("debugger"); 3824 CompileRun("debugger");
3814 3825
3815 // The host dispatch callback should be called. 3826 // The host dispatch callback should be called.
3816 CHECK_EQ(1, host_dispatch_hit_count); 3827 CHECK_EQ(1, host_dispatch_hit_count);
3817 } 3828 }
OLDNEW
« no previous file with comments | « src/mirror-delay.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698