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

Side by Side Diff: test/mjsunit/debug-breakpoints.js

Issue 2883042: Breakpoint position should be inside function body. (Closed)
Patch Set: Created 10 years, 4 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 2008 the V8 project authors. All rights reserved. 1 // Copyright 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 25 matching lines...) Expand all
36 } 36 }
37 37
38 bp = Debug.setBreakPoint(f, 0, 0); 38 bp = Debug.setBreakPoint(f, 0, 0);
39 assertEquals("() {[B0]a=1;b=2}", Debug.showBreakPoints(f)); 39 assertEquals("() {[B0]a=1;b=2}", Debug.showBreakPoints(f));
40 Debug.clearBreakPoint(bp); 40 Debug.clearBreakPoint(bp);
41 assertEquals("() {a=1;b=2}", Debug.showBreakPoints(f)); 41 assertEquals("() {a=1;b=2}", Debug.showBreakPoints(f));
42 bp1 = Debug.setBreakPoint(f, 0, 8); 42 bp1 = Debug.setBreakPoint(f, 0, 8);
43 assertEquals("() {a=1;[B0]b=2}", Debug.showBreakPoints(f)); 43 assertEquals("() {a=1;[B0]b=2}", Debug.showBreakPoints(f));
44 bp2 = Debug.setBreakPoint(f, 0, 4); 44 bp2 = Debug.setBreakPoint(f, 0, 4);
45 assertEquals("() {[B0]a=1;[B1]b=2}", Debug.showBreakPoints(f)); 45 assertEquals("() {[B0]a=1;[B1]b=2}", Debug.showBreakPoints(f));
46 bp3 = Debug.setBreakPoint(f, 0, 12); 46 bp3 = Debug.setBreakPoint(f, 0, 11);
47 assertEquals("() {[B0]a=1;[B1]b=2}[B2]", Debug.showBreakPoints(f)); 47 assertEquals("() {[B0]a=1;[B1]b=2[B2]}", Debug.showBreakPoints(f));
48 Debug.clearBreakPoint(bp1); 48 Debug.clearBreakPoint(bp1);
49 assertEquals("() {[B0]a=1;b=2}[B1]", Debug.showBreakPoints(f)); 49 assertEquals("() {[B0]a=1;b=2[B1]}", Debug.showBreakPoints(f));
50 Debug.clearBreakPoint(bp2); 50 Debug.clearBreakPoint(bp2);
51 assertEquals("() {a=1;b=2}[B0]", Debug.showBreakPoints(f)); 51 assertEquals("() {a=1;b=2[B0]}", Debug.showBreakPoints(f));
52 Debug.clearBreakPoint(bp3); 52 Debug.clearBreakPoint(bp3);
53 assertEquals("() {a=1;b=2}", Debug.showBreakPoints(f)); 53 assertEquals("() {a=1;b=2}", Debug.showBreakPoints(f));
54 54
55 // The following test checks that the Debug.showBreakPoints(g) produces output 55 // The following test checks that the Debug.showBreakPoints(g) produces output
56 // like follows when changein breakpoints. 56 // like follows when changein breakpoints.
57 // 57 //
58 // function g() { 58 // function g() {
59 // [BX]a=1; 59 // [BX]a=1;
60 // [BX]b=2; 60 // [BX]b=2;
61 // }[BX] 61 // }[BX]
(...skipping 27 matching lines...) Expand all
89 // } 89 // }
90 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]a=1;") > 0); 90 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]a=1;") > 0);
91 assertTrue(Debug.showBreakPoints(g).indexOf("[B1]b=2;") > 0); 91 assertTrue(Debug.showBreakPoints(g).indexOf("[B1]b=2;") > 0);
92 bp3 = Debug.setBreakPoint(g, 3, 0); 92 bp3 = Debug.setBreakPoint(g, 3, 0);
93 // function g() { 93 // function g() {
94 // [B0]a=1; 94 // [B0]a=1;
95 // [B1]b=2; 95 // [B1]b=2;
96 // }[B2] 96 // }[B2]
97 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]a=1;") > 0); 97 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]a=1;") > 0);
98 assertTrue(Debug.showBreakPoints(g).indexOf("[B1]b=2;") > 0); 98 assertTrue(Debug.showBreakPoints(g).indexOf("[B1]b=2;") > 0);
99 assertTrue(Debug.showBreakPoints(g).indexOf("}[B2]") > 0); 99 assertTrue(Debug.showBreakPoints(g).indexOf("[B2]}") > 0);
100 Debug.clearBreakPoint(bp1); 100 Debug.clearBreakPoint(bp1);
101 // function g() { 101 // function g() {
102 // [B0]a=1; 102 // [B0]a=1;
103 // b=2; 103 // b=2;
104 // }[B1] 104 // }[B1]
105 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]a=1;") > 0); 105 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]a=1;") > 0);
106 assertTrue(Debug.showBreakPoints(g).indexOf("}[B1]") > 0); 106 assertTrue(Debug.showBreakPoints(g).indexOf("[B1]}") > 0);
107 assertTrue(Debug.showBreakPoints(g).indexOf("[B2]") < 0); 107 assertTrue(Debug.showBreakPoints(g).indexOf("[B2]") < 0);
108 Debug.clearBreakPoint(bp2); 108 Debug.clearBreakPoint(bp2);
109 // function g() { 109 // function g() {
110 // a=1; 110 // a=1;
111 // b=2; 111 // b=2;
112 // }[B0] 112 // }[B0]
113 assertTrue(Debug.showBreakPoints(g).indexOf("}[B0]") > 0); 113 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]}") > 0);
114 assertTrue(Debug.showBreakPoints(g).indexOf("[B1]") < 0); 114 assertTrue(Debug.showBreakPoints(g).indexOf("[B1]") < 0);
115 Debug.clearBreakPoint(bp3); 115 Debug.clearBreakPoint(bp3);
116 // function g() { 116 // function g() {
117 // a=1; 117 // a=1;
118 // b=2; 118 // b=2;
119 // } 119 // }
120 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]") < 0); 120 assertTrue(Debug.showBreakPoints(g).indexOf("[B0]") < 0);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698