Commit 5bba0d1a authored by mtrofin's avatar mtrofin Committed by Commit Bot

Revert of [inspector] Test how Profiler interacts with multiple sessions...

Revert of [inspector] Test how Profiler interacts with multiple sessions (patchset #2 id:10003 of https://codereview.chromium.org/2920313002/ )

Reason for revert:
Bot failure:

https://build.chromium.org/p/client.v8/builders/V8%20Linux%20gcc%204.8/builds/13172

Original issue's description:
> [inspector] Test how Profiler interacts with multiple sessions
>
> BUG=chromium:590878
>
> Review-Url: https://codereview.chromium.org/2920313002
> Cr-Commit-Position: refs/heads/master@{#45715}
> Committed: https://chromium.googlesource.com/v8/v8/+/754f81e20e9e7abfb3ce82e73a3389a72f4657a6

TBR=alph@chromium.org,dgozman@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:590878

Review-Url: https://codereview.chromium.org/2928493002
Cr-Commit-Position: refs/heads/master@{#45716}
parent 754f81e2
Tests that multiple sessions can record profiles concurrently.
console.profile in 1
console profile started from 2: one
console profile started from 1: one
console profile finished from 2: one
Found foo() call in profile: true
console profile finished from 1: one
Found foo() call in profile: true
console.profile in 2
console profile started from 2: two
console profile started from 1: two
console profile finished from 2: two
Found foo() call in profile: true
console profile finished from 1: two
Found foo() call in profile: true
starting in 1
starting in 2
stopping in 1
stopped in 1
Found foo() call in profile: true
stopping in 2
stopped in 2
Found foo() call in profile: true
// Copyright 2017 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.
InspectorTest.log('Tests that multiple sessions can record profiles concurrently.');
var contextGroup = new InspectorTest.ContextGroup();
contextGroup.addScript(`
function foo() {
var doSomeWork = 1;
for (var i = 0; i < 10000000; i++)
doSomeWork += i;
return doSomeWork;
}
//# sourceURL=test.js`, 7, 26);
function checkProfile(profile) {
var foundFoo = profile.nodes.some(node => node.callFrame.functionName === 'foo');
InspectorTest.log(`Found foo() call in profile: ${foundFoo}`);
}
(async function test() {
var session1 = await connect(contextGroup, 1);
var session2 = await connect(contextGroup, 2);
InspectorTest.log('console.profile in 1');
await session1.Protocol.Runtime.evaluate({expression: 'console.profile("one"); foo(); console.profileEnd("one");'});
InspectorTest.log('console.profile in 2');
await session2.Protocol.Runtime.evaluate({expression: 'console.profile("two"); foo(); console.profileEnd("two");'});
InspectorTest.log('starting in 1');
session1.Protocol.Profiler.start();
InspectorTest.log('starting in 2');
session2.Protocol.Profiler.start();
await session1.Protocol.Runtime.evaluate({expression: 'foo();'});
InspectorTest.log('stopping in 1');
var message = await session1.Protocol.Profiler.stop();
InspectorTest.log('stopped in 1');
checkProfile(message.result.profile);
InspectorTest.log('stopping in 2');
var message = await session2.Protocol.Profiler.stop();
InspectorTest.log('stopped in 2');
checkProfile(message.result.profile);
InspectorTest.completeTest();
})();
async function connect(contextGroup, num) {
var session = contextGroup.connect();
session.Protocol.Profiler.onConsoleProfileStarted(message => {
InspectorTest.log(`console profile started from ${num}: ${message.params.title}`);
});
session.Protocol.Profiler.onConsoleProfileFinished(message => {
InspectorTest.log(`console profile finished from ${num}: ${message.params.title}`);
checkProfile(message.params.profile);
});
await session.Protocol.Profiler.enable();
await session.Protocol.Profiler.setSamplingInterval({interval: 100});
return session;
}
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