| Index: test/debugger/debug/debug-multiple-breakpoints.js
|
| diff --git a/test/mjsunit/debug-multiple-breakpoints.js b/test/debugger/debug/debug-multiple-breakpoints.js
|
| similarity index 80%
|
| rename from test/mjsunit/debug-multiple-breakpoints.js
|
| rename to test/debugger/debug/debug-multiple-breakpoints.js
|
| index d8b1d943f4c38c7714af5e40e549f6dcdbe6ef25..6e19140b6aaf8c2aab63bcf0147ebb5cb13e312b 100644
|
| --- a/test/mjsunit/debug-multiple-breakpoints.js
|
| +++ b/test/debugger/debug/debug-multiple-breakpoints.js
|
| @@ -25,8 +25,6 @@
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
| -// Flags: --expose-debug-as debug
|
| -// Get the Debug object exposed from the debug context global object.
|
| Debug = debug.Debug
|
|
|
| // Simple debug event handler which just counts the number of break points hit.
|
| @@ -58,19 +56,14 @@ f();
|
| assertEquals(1, break_point_hit_count);
|
|
|
| // Set another breakpoint in f at the same place.
|
| -bp2 = Debug.setBreakPoint(f);
|
| +assertThrows(() => Debug.setBreakPoint(f));
|
| f();
|
| assertEquals(2, break_point_hit_count);
|
|
|
| -// Remove one of the break points.
|
| +// Remove the break points.
|
| Debug.clearBreakPoint(bp1);
|
| f();
|
| -assertEquals(3, break_point_hit_count);
|
| -
|
| -// Remove the second break point.
|
| -Debug.clearBreakPoint(bp2);
|
| -f();
|
| -assertEquals(3, break_point_hit_count);
|
| +assertEquals(2, break_point_hit_count);
|
|
|
| // Perform the same test using function g (this time removing the break points
|
| // in the another order).
|
| @@ -78,28 +71,22 @@ break_point_hit_count = 0;
|
| bp1 = Debug.setBreakPoint(g);
|
| g();
|
| assertEquals(1, break_point_hit_count);
|
| -bp2 = Debug.setBreakPoint(g);
|
| +assertThrows(() => Debug.setBreakPoint(g));
|
| g();
|
| assertEquals(2, break_point_hit_count);
|
| -Debug.clearBreakPoint(bp2);
|
| -g();
|
| -assertEquals(3, break_point_hit_count);
|
| Debug.clearBreakPoint(bp1);
|
| g();
|
| -assertEquals(3, break_point_hit_count);
|
| +assertEquals(2, break_point_hit_count);
|
|
|
| // Finally test with many break points.
|
| test_count = 10;
|
| -bps = new Array(test_count);
|
| break_point_hit_count = 0;
|
| for (var i = 0; i < test_count; i++) {
|
| - bps[i] = Debug.setBreakPoint(h);
|
| - h();
|
| -}
|
| -for (var i = 0; i < test_count; i++) {
|
| + if (i == 0) {
|
| + Debug.setBreakPoint(h);
|
| + } else {
|
| + assertThrows(() => Debug.setBreakPoint(h));
|
| + }
|
| h();
|
| - Debug.clearBreakPoint(bps[i]);
|
| }
|
| -assertEquals(test_count * 2, break_point_hit_count);
|
| -h();
|
| -assertEquals(test_count * 2, break_point_hit_count);
|
| +assertEquals(test_count, break_point_hit_count);
|
|
|