Commit 5c32385a authored by sgjesse@chromium.org's avatar sgjesse@chromium.org

Change the tests which looks at the number of scripts in the VM after startup...

Change the tests which looks at the number of scripts in the VM after startup to ignore native scripts without name.

Native scripts without name are currently only the script holding the empty script and the script holding the source for the empty function. These two unnamed scripts are created for each context. When running with snapshot an additional context is created during startup adding two more native scripts that in the non-snapshot case.
Review URL: http://codereview.chromium.org/39333

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@1448 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 5b1ae4a0
......@@ -33,28 +33,26 @@ Date();
RegExp();
// Count script types.
var native_count = 0;
var named_native_count = 0;
var extension_count = 0;
var normal_count = 0;
var scripts = Debug.scripts();
for (i = 0; i < scripts.length; i++) {
if (scripts[i].type == Debug.ScriptType.Native) {
native_count++;
if (scripts[i].name) {
named_native_count++;
}
} else if (scripts[i].type == Debug.ScriptType.Extension) {
extension_count++;
} else if (scripts[i].type == Debug.ScriptType.Normal) {
if (!scripts[i].name) print("X" + scripts[i].source + "X"); // empty script
else {
print(scripts[i].name);
normal_count++;
}
normal_count++;
} else {
assertUnreachable('Unexpected type ' + scripts[i].type);
}
}
// This has to be updated if the number of native scripts change.
assertEquals(16, native_count);
assertEquals(12, named_native_count);
// If no snapshot is used, only the 'gc' extension is loaded.
// If snapshot is used, all extensions are cached in the snapshot.
assertTrue(extension_count == 1 || extension_count == 5);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment