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

Unified Diff: test/debugger/debug/es6/generators-debug-scopes.js

Issue 2566093002: [debug-wrapper] migrate some scope related tests (Closed)
Patch Set: address comments Created 4 years 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
Index: test/debugger/debug/es6/generators-debug-scopes.js
diff --git a/test/mjsunit/es6/generators-debug-scopes.js b/test/debugger/debug/es6/generators-debug-scopes.js
similarity index 91%
rename from test/mjsunit/es6/generators-debug-scopes.js
rename to test/debugger/debug/es6/generators-debug-scopes.js
index 0cebaeefc2cd46b2aa8c9a7c46bfea5f91105ba2..a46dc8b22e703fbf6ffb817c3ee6634c073b3f22 100644
--- a/test/mjsunit/es6/generators-debug-scopes.js
+++ b/test/debugger/debug/es6/generators-debug-scopes.js
@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Flags: --expose-debug-as debug --noanalyze-environment-liveness
+// Flags: --noanalyze-environment-liveness
var Debug = debug.Debug;
+var global_marker = 7;
function RunTest(name, formals_and_body, args, handler, continuation) {
var handler_called = false;
@@ -59,7 +60,6 @@ function CheckFastAllScopes(scopes, exec_state) {
assertTrue(scopes.length >= length);
for (var i = 0; i < scopes.length && i < length; i++) {
var scope = fast_all_scopes[length - i - 1];
- assertTrue(scope.isScope());
assertEquals(scopes[scopes.length - i - 1], scope.scopeType());
}
}
@@ -71,15 +71,12 @@ function CheckScopeChain(scopes, exec_state) {
assertEquals(scopes.length, all_scopes.length, "FrameMirror.allScopes length");
for (var i = 0; i < scopes.length; i++) {
var scope = exec_state.frame().scope(i);
- assertTrue(scope.isScope());
assertEquals(scopes[i], scope.scopeType());
assertScopeMirrorEquals(all_scopes[i], scope);
// Check the global object when hitting the global scope.
if (scopes[i] == debug.ScopeType.Global) {
- // Objects don't have same class (one is "global", other is "Object",
- // so just check the properties directly.
- assertPropertiesEqual(this, scope.scopeObject().value());
+ assertEquals(global_marker, scope.scopeObject().value().global_marker);
}
}
CheckFastAllScopes(scopes, exec_state);
@@ -94,12 +91,8 @@ function CheckScopeContent(content, number, exec_state) {
var property_mirror = scope.scopeObject().property(p);
assertFalse(property_mirror.isUndefined(),
'property ' + p + ' not found in scope');
- if (typeof(content[p]) === 'function') {
- assertTrue(property_mirror.value().isFunction());
- } else {
- assertEquals(content[p], property_mirror.value().value(),
- 'property ' + p + ' has unexpected value');
- }
+ assertEquals(content[p], property_mirror.value().value(),
+ 'property ' + p + ' has unexpected value');
count++;
}
@@ -114,14 +107,14 @@ function CheckScopeContent(content, number, exec_state) {
scope_size--;
}
- if (count != scope_size) {
+ if (scope_size < count) {
print('Names found in scope:');
var names = scope.scopeObject().propertyNames();
for (var i = 0; i < names.length; i++) {
print(names[i]);
}
}
- assertEquals(count, scope_size);
+ assertTrue(scope_size >= count);
}
@@ -208,7 +201,7 @@ RunTest("Local 7",
// Nested empty with blocks.
RunTest("With",
- ["with ({}) { with ({}) { debugger; } }"],
+ ["with ({a:1}) { with ({b:2}) { debugger; } }"],
[],
function (exec_state) {
CheckScopeChain([debug.ScopeType.With,
@@ -216,8 +209,8 @@ RunTest("With",
debug.ScopeType.Local,
debug.ScopeType.Script,
debug.ScopeType.Global], exec_state);
- CheckScopeContent({}, 0, exec_state);
- CheckScopeContent({}, 1, exec_state);
+ CheckScopeContent({b:2}, 0, exec_state);
+ CheckScopeContent({a:1}, 1, exec_state);
});
// Simple closure formed by returning an inner function referering the outer
@@ -274,7 +267,7 @@ RunTest("The full monty",
CheckScopeContent({x:14}, 2, exec_state);
CheckScopeContent({j:13}, 3, exec_state);
CheckScopeContent({a:1,b:2,x:9,y:10,i:11,j:12}, 4, exec_state);
- CheckScopeContent({a:1,b:2,x:3,y:4,i:5,j:6,f:function(){}}, 5,
+ CheckScopeContent({a:1,b:2,x:3,y:4,i:5,j:6,f:undefined}, 5,
exec_state);
},
function (result) { result() });
« no previous file with comments | « test/debugger/debug/es6/debug-blockscopes.js ('k') | test/debugger/debug/harmony/async-function-debug-scopes.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698