v8/test/inspector/debugger/script-parsed-hash.js
Alexey Kozyatinskiy df6d46983f [inspector] fixed script-parsed-hash.js test
Original intention of longScript was to check how hashing works with long
script source. Current implementation calculates hash for longString function,
it's non reliable since Function.toString is still not specified and can return
different line endings on different architectures.

TBR=dgozman@chromium.org

Bug: none
Change-Id: I4c5b6f30c2849a1a2702c74665b86ced731f1b28
Reviewed-on: https://chromium-review.googlesource.com/609486
Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47268}
2017-08-10 07:00:53 +00:00

30 lines
1.1 KiB
JavaScript

// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
let {session, contextGroup, Protocol} =
InspectorTest.start('Tests scripts hasing');
(async function test() {
await Protocol.Debugger.enable();
await Protocol.Runtime.enable();
Protocol.Runtime.compileScript({
expression: "1", sourceURL: "foo1.js", persistScript: true});
let {params} = await Protocol.Debugger.onceScriptParsed();
InspectorTest.logMessage(params);
Protocol.Runtime.compileScript({
expression: "239", sourceURL: "foo2.js", persistScript: true});
({params} = await Protocol.Debugger.onceScriptParsed());
InspectorTest.logMessage(params);
var script = "var b = 1;";
for (var i = 0; i < 2024; ++i) {
script += "++b;";
}
Protocol.Runtime.compileScript({
expression: script, sourceURL: "foo3.js",
persistScript: true});
({params} = await Protocol.Debugger.onceScriptParsed());
InspectorTest.logMessage(params);
InspectorTest.completeTest();
})()