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

Unified Diff: test/debugger/debug/debug-compile-event.js

Issue 2497973002: [debug-wrapper] Further extend the debug wrapper (Closed)
Patch Set: Address comments Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/debugger/debug/debug-breakpoints.js ('k') | test/debugger/debug/debug-enable-disable-breakpoints.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/debugger/debug/debug-compile-event.js
diff --git a/test/mjsunit/debug-compile-event.js b/test/debugger/debug/debug-compile-event.js
similarity index 80%
rename from test/mjsunit/debug-compile-event.js
rename to test/debugger/debug/debug-compile-event.js
index 862340602b34c6b145d872bdc64efa643d1592e1..2e5260959187d752dc3aabfa55e717db99791518 100644
--- a/test/mjsunit/debug-compile-event.js
+++ b/test/debugger/debug/debug-compile-event.js
@@ -25,18 +25,13 @@
// (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
var exception = false; // Exception in debug event listener.
-var before_compile_count = 0;
var after_compile_count = 0;
var compile_error_count = 0;
var current_source = ''; // Current source being compiled.
var source_count = 0; // Total number of scources compiled.
-var host_compilations = 0; // Number of scources compiled through the API.
-var eval_compilations = 0; // Number of scources compiled through eval.
var mute_listener = false;
function compileSource(source) {
@@ -64,19 +59,9 @@ function listener(event, exec_state, event_data, data) {
event == Debug.DebugEvent.AfterCompile ||
event == Debug.DebugEvent.CompileError) {
// Count the events.
- if (event == Debug.DebugEvent.BeforeCompile) {
- before_compile_count++;
- } else if (event == Debug.DebugEvent.AfterCompile) {
+ if (event == Debug.DebugEvent.AfterCompile) {
after_compile_count++;
- switch (event_data.script().compilationType()) {
- case Debug.ScriptCompilationType.Host:
- host_compilations++;
- break;
- case Debug.ScriptCompilationType.Eval:
- eval_compilations++;
- break;
- }
- } else {
+ } else if (event == Debug.DebugEvent.CompileError) {
compile_error_count++;
}
@@ -91,10 +76,6 @@ function listener(event, exec_state, event_data, data) {
// exact source.
assertEquals(current_source, event_data.script().source());
}
- // Check that script context is included into the event message.
- var json = event_data.toJSONProtocol();
- var msg = safeEval(json);
- assertTrue('context' in msg.body.script);
// Check that we pick script name from //# sourceURL, iff present
if (event == Debug.DebugEvent.AfterCompile) {
@@ -132,13 +113,10 @@ try {
assertFalse(exception, "exception in listener")
// Number of before and after + error events should be the same.
-assertEquals(before_compile_count, after_compile_count + compile_error_count);
assertEquals(compile_error_count, 1);
// Check the actual number of events (no compilation through the API as all
// source compiled through eval).
assertEquals(source_count, after_compile_count);
-assertEquals(0, host_compilations);
-assertEquals(source_count, eval_compilations);
Debug.setListener(null);
« no previous file with comments | « test/debugger/debug/debug-breakpoints.js ('k') | test/debugger/debug/debug-enable-disable-breakpoints.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698