| OLD | NEW |
| 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 testArguments(dcp, '{"breakpoint":' + (breakpoint + 1) + ',"condition":"fals
e"}', false); | 72 testArguments(dcp, '{"breakpoint":' + (breakpoint + 1) + ',"condition":"fals
e"}', false); |
| 73 testArguments(dcp, '{"breakpoint":"xx","condition":"false"}', false); | 73 testArguments(dcp, '{"breakpoint":"xx","condition":"false"}', false); |
| 74 | 74 |
| 75 // Test some legal clearbreakpoint requests. | 75 // Test some legal clearbreakpoint requests. |
| 76 var bp_str = '"breakpoint":' + breakpoint;; | 76 var bp_str = '"breakpoint":' + breakpoint;; |
| 77 testArguments(dcp, '{' + bp_str + '}', true); | 77 testArguments(dcp, '{' + bp_str + '}', true); |
| 78 testArguments(dcp, '{' + bp_str + ',"enabled":"true"}', true); | 78 testArguments(dcp, '{' + bp_str + ',"enabled":"true"}', true); |
| 79 testArguments(dcp, '{' + bp_str + ',"enabled":"false"}', true); | 79 testArguments(dcp, '{' + bp_str + ',"enabled":"false"}', true); |
| 80 testArguments(dcp, '{' + bp_str + ',"condition":"1==2"}', true); | 80 testArguments(dcp, '{' + bp_str + ',"condition":"1==2"}', true); |
| 81 testArguments(dcp, '{' + bp_str + ',"condition":"false"}', true); | 81 testArguments(dcp, '{' + bp_str + ',"condition":"false"}', true); |
| 82 testArguments(dcp, '{' + bp_str + ',"ignoreCount":7}', true); | |
| 83 testArguments(dcp, '{' + bp_str + ',"ignoreCount":0}', true); | |
| 84 testArguments( | |
| 85 dcp, | |
| 86 '{' + bp_str + ',"enabled":"true","condition":"false","ignoreCount":0}', | |
| 87 true); | |
| 88 | 82 |
| 89 // Indicate that all was processed. | 83 // Indicate that all was processed. |
| 90 listenerComplete = true; | 84 listenerComplete = true; |
| 91 } | 85 } |
| 92 } catch (e) { | 86 } catch (e) { |
| 93 exception = e | 87 exception = e |
| 94 }; | 88 }; |
| 95 }; | 89 }; |
| 96 | 90 |
| 97 // Add the debug event listener. | 91 // Add the debug event listener. |
| 98 Debug.setListener(listener); | 92 Debug.setListener(listener); |
| 99 | 93 |
| 100 function g() {}; | 94 function g() {}; |
| 101 | 95 |
| 102 // Set a break point and call to invoke the debug event listener. | 96 // Set a break point and call to invoke the debug event listener. |
| 103 breakpoint = Debug.setBreakPoint(g, 0, 0); | 97 breakpoint = Debug.setBreakPoint(g, 0, 0); |
| 104 g(); | 98 g(); |
| 105 | 99 |
| 106 // Make sure that the debug event listener vas invoked. | 100 // Make sure that the debug event listener vas invoked. |
| 107 assertTrue(listenerComplete, "listener did not run to completion"); | 101 assertTrue(listenerComplete, "listener did not run to completion"); |
| 108 assertFalse(exception, "exception in listener") | 102 assertFalse(exception, "exception in listener") |
| OLD | NEW |