diff options
Diffstat (limited to 'deps/v8/test/inspector/cpu-profiler')
11 files changed, 69 insertions, 27 deletions
diff --git a/deps/v8/test/inspector/cpu-profiler/console-profile-end-parameterless-crash-expected.txt b/deps/v8/test/inspector/cpu-profiler/console-profile-end-parameterless-crash-expected.txt index a28765a100..a2988ad4c3 100644 --- a/deps/v8/test/inspector/cpu-profiler/console-profile-end-parameterless-crash-expected.txt +++ b/deps/v8/test/inspector/cpu-profiler/console-profile-end-parameterless-crash-expected.txt @@ -1,3 +1,3 @@ Tests that "console.profileEnd()" does not cause crash. (webkit:105759) SUCCESS: found 2 profile headers -SUCCESS: titled profile found
\ No newline at end of file +SUCCESS: titled profile found diff --git a/deps/v8/test/inspector/cpu-profiler/console-profile-end-parameterless-crash.js b/deps/v8/test/inspector/cpu-profiler/console-profile-end-parameterless-crash.js index 415b703c36..d0d995e37e 100644 --- a/deps/v8/test/inspector/cpu-profiler/console-profile-end-parameterless-crash.js +++ b/deps/v8/test/inspector/cpu-profiler/console-profile-end-parameterless-crash.js @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -InspectorTest.log("Tests that \"console.profileEnd()\" does not cause crash. (webkit:105759)"); +let {session, contextGroup, Protocol} = InspectorTest.start("Tests that \"console.profileEnd()\" does not cause crash. (webkit:105759)"); -InspectorTest.addScript(` +contextGroup.addScript(` function collectProfiles() { console.profile(); diff --git a/deps/v8/test/inspector/cpu-profiler/console-profile-expected.txt b/deps/v8/test/inspector/cpu-profiler/console-profile-expected.txt index b3da7ba0c1..7bb8bc940d 100644 --- a/deps/v8/test/inspector/cpu-profiler/console-profile-expected.txt +++ b/deps/v8/test/inspector/cpu-profiler/console-profile-expected.txt @@ -1,3 +1,3 @@ Tests that console.profile/profileEnd will record CPU profile when inspector front-end is connected. SUCCESS: retrieved '42' profile -SUCCESS: found 'collectProfiles' function in the profile
\ No newline at end of file +SUCCESS: found 'collectProfiles' function in the profile diff --git a/deps/v8/test/inspector/cpu-profiler/console-profile.js b/deps/v8/test/inspector/cpu-profiler/console-profile.js index b8e36b6861..9aa7542cea 100644 --- a/deps/v8/test/inspector/cpu-profiler/console-profile.js +++ b/deps/v8/test/inspector/cpu-profiler/console-profile.js @@ -2,9 +2,9 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -InspectorTest.log("Tests that console.profile/profileEnd will record CPU profile when inspector front-end is connected."); +let {session, contextGroup, Protocol} = InspectorTest.start("Tests that console.profile/profileEnd will record CPU profile when inspector front-end is connected."); -InspectorTest.addScript(` +contextGroup.addScript(` function collectProfiles() { console.profile("outer"); diff --git a/deps/v8/test/inspector/cpu-profiler/coverage.js b/deps/v8/test/inspector/cpu-profiler/coverage.js index a059467b2e..ce4995fd1c 100644 --- a/deps/v8/test/inspector/cpu-profiler/coverage.js +++ b/deps/v8/test/inspector/cpu-profiler/coverage.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --allow-natives-syntax --no-always-opt --crankshaft +// Flags: --allow-natives-syntax --no-always-opt --opt var source = ` @@ -50,7 +50,7 @@ var f = (function outer() { f()()(); `; -InspectorTest.log("Test collecting code coverage data with Profiler.collectCoverage."); +let {session, contextGroup, Protocol} = InspectorTest.start("Test collecting code coverage data with Profiler.collectCoverage."); function ClearAndGC() { return Protocol.Runtime.evaluate({ expression: "fib = g = f = h = is_optimized = null;" }) diff --git a/deps/v8/test/inspector/cpu-profiler/enable-disable-expected.txt b/deps/v8/test/inspector/cpu-profiler/enable-disable-expected.txt index 05d3fd3d5f..aa3507c934 100644 --- a/deps/v8/test/inspector/cpu-profiler/enable-disable-expected.txt +++ b/deps/v8/test/inspector/cpu-profiler/enable-disable-expected.txt @@ -5,4 +5,4 @@ PASS: console initiated profile started PASS: didStartConsoleProfile PASS: didDisableProfiler PASS: no front-end initiated profiles found -PASS: didStopConsoleProfile
\ No newline at end of file +PASS: didStopConsoleProfile diff --git a/deps/v8/test/inspector/cpu-profiler/enable-disable.js b/deps/v8/test/inspector/cpu-profiler/enable-disable.js index b342a162c4..0e9b94dc5c 100644 --- a/deps/v8/test/inspector/cpu-profiler/enable-disable.js +++ b/deps/v8/test/inspector/cpu-profiler/enable-disable.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -InspectorTest.log("Test that profiling can only be started when Profiler was enabled and that Profiler.disable command will stop recording all profiles."); +let {session, contextGroup, Protocol} = InspectorTest.start("Test that profiling can only be started when Profiler was enabled and that Profiler.disable command will stop recording all profiles."); Protocol.Profiler.start().then(didFailToStartWhenDisabled); disallowConsoleProfiles(); @@ -31,7 +31,7 @@ function allowConsoleProfiles() } function didFailToStartWhenDisabled(messageObject) { - if (!InspectorTest.expectedError("didFailToStartWhenDisabled", messageObject)) + if (!expectedError("didFailToStartWhenDisabled", messageObject)) return; allowConsoleProfiles(); Protocol.Profiler.enable(); @@ -39,21 +39,21 @@ function didFailToStartWhenDisabled(messageObject) } function didStartFrontendProfile(messageObject) { - if (!InspectorTest.expectedSuccess("didStartFrontendProfile", messageObject)) + if (!expectedSuccess("didStartFrontendProfile", messageObject)) return; Protocol.Runtime.evaluate({expression: "console.profile('p1');"}).then(didStartConsoleProfile); } function didStartConsoleProfile(messageObject) { - if (!InspectorTest.expectedSuccess("didStartConsoleProfile", messageObject)) + if (!expectedSuccess("didStartConsoleProfile", messageObject)) return; Protocol.Profiler.disable().then(didDisableProfiler); } function didDisableProfiler(messageObject) { - if (!InspectorTest.expectedSuccess("didDisableProfiler", messageObject)) + if (!expectedSuccess("didDisableProfiler", messageObject)) return; Protocol.Profiler.enable(); Protocol.Profiler.stop().then(didStopFrontendProfile); @@ -61,7 +61,7 @@ function didDisableProfiler(messageObject) function didStopFrontendProfile(messageObject) { - if (!InspectorTest.expectedError("no front-end initiated profiles found", messageObject)) + if (!expectedError("no front-end initiated profiles found", messageObject)) return; disallowConsoleProfiles(); Protocol.Runtime.evaluate({expression: "console.profileEnd();"}).then(didStopConsoleProfile); @@ -69,7 +69,21 @@ function didStopFrontendProfile(messageObject) function didStopConsoleProfile(messageObject) { - if (!InspectorTest.expectedSuccess("didStopConsoleProfile", messageObject)) + if (!expectedSuccess("didStopConsoleProfile", messageObject)) return; InspectorTest.completeTest(); } + +function checkExpectation(fail, name, messageObject) +{ + if (fail === !!messageObject.error) { + InspectorTest.log("PASS: " + name); + return true; + } + + InspectorTest.log("FAIL: " + name + ": " + JSON.stringify(messageObject)); + InspectorTest.completeTest(); + return false; +} +var expectedSuccess = checkExpectation.bind(null, false); +var expectedError = checkExpectation.bind(null, true); diff --git a/deps/v8/test/inspector/cpu-profiler/record-cpu-profile-expected.txt b/deps/v8/test/inspector/cpu-profiler/record-cpu-profile-expected.txt index d810093968..4ff20a253d 100644 --- a/deps/v8/test/inspector/cpu-profiler/record-cpu-profile-expected.txt +++ b/deps/v8/test/inspector/cpu-profiler/record-cpu-profile-expected.txt @@ -4,4 +4,4 @@ PASS: startConsoleProfile PASS: stopConsoleProfile PASS: stoppedFrontendProfile PASS: startFrontendProfileSecondTime -PASS: stopFrontendProfileSecondTime
\ No newline at end of file +PASS: stopFrontendProfileSecondTime diff --git a/deps/v8/test/inspector/cpu-profiler/record-cpu-profile.js b/deps/v8/test/inspector/cpu-profiler/record-cpu-profile.js index c87d600124..3799cf74f5 100644 --- a/deps/v8/test/inspector/cpu-profiler/record-cpu-profile.js +++ b/deps/v8/test/inspector/cpu-profiler/record-cpu-profile.js @@ -2,47 +2,61 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -InspectorTest.log("Test that profiler is able to record a profile. Also it tests that profiler returns an error when it unable to find the profile."); +let {session, contextGroup, Protocol} = InspectorTest.start("Test that profiler is able to record a profile. Also it tests that profiler returns an error when it unable to find the profile."); Protocol.Profiler.enable(); Protocol.Profiler.start().then(didStartFrontendProfile); function didStartFrontendProfile(messageObject) { - if (!InspectorTest.expectedSuccess("startFrontendProfile", messageObject)) + if (!expectedSuccess("startFrontendProfile", messageObject)) return; Protocol.Runtime.evaluate({expression: "console.profile('Profile 1');"}).then(didStartConsoleProfile); } function didStartConsoleProfile(messageObject) { - if (!InspectorTest.expectedSuccess("startConsoleProfile", messageObject)) + if (!expectedSuccess("startConsoleProfile", messageObject)) return; Protocol.Runtime.evaluate({expression: "console.profileEnd('Profile 1');"}).then(didStopConsoleProfile); } function didStopConsoleProfile(messageObject) { - if (!InspectorTest.expectedSuccess("stopConsoleProfile", messageObject)) + if (!expectedSuccess("stopConsoleProfile", messageObject)) return; Protocol.Profiler.stop().then(didStopFrontendProfile); } function didStopFrontendProfile(messageObject) { - if (!InspectorTest.expectedSuccess("stoppedFrontendProfile", messageObject)) + if (!expectedSuccess("stoppedFrontendProfile", messageObject)) return; Protocol.Profiler.start().then(didStartFrontendProfile2); } function didStartFrontendProfile2(messageObject) { - if (!InspectorTest.expectedSuccess("startFrontendProfileSecondTime", messageObject)) + if (!expectedSuccess("startFrontendProfileSecondTime", messageObject)) return; Protocol.Profiler.stop().then(didStopFrontendProfile2); } function didStopFrontendProfile2(messageObject) { - InspectorTest.expectedSuccess("stopFrontendProfileSecondTime", messageObject) + expectedSuccess("stopFrontendProfileSecondTime", messageObject) InspectorTest.completeTest(); } + +function checkExpectation(fail, name, messageObject) +{ + if (fail === !!messageObject.error) { + InspectorTest.log("PASS: " + name); + return true; + } + + InspectorTest.log("FAIL: " + name + ": " + JSON.stringify(messageObject)); + InspectorTest.completeTest(); + return false; +} +var expectedSuccess = checkExpectation.bind(null, false); +var expectedError = checkExpectation.bind(null, true); diff --git a/deps/v8/test/inspector/cpu-profiler/stop-without-preceeding-start-expected.txt b/deps/v8/test/inspector/cpu-profiler/stop-without-preceeding-start-expected.txt index 91b5c9e6e2..2c6dd1e38f 100644 --- a/deps/v8/test/inspector/cpu-profiler/stop-without-preceeding-start-expected.txt +++ b/deps/v8/test/inspector/cpu-profiler/stop-without-preceeding-start-expected.txt @@ -1,2 +1,2 @@ Test that profiler doesn't crash when we call stop without preceeding start. -PASS: ProfileAgent.stop
\ No newline at end of file +PASS: ProfileAgent.stop diff --git a/deps/v8/test/inspector/cpu-profiler/stop-without-preceeding-start.js b/deps/v8/test/inspector/cpu-profiler/stop-without-preceeding-start.js index 5fdf098fe1..5f21e653f1 100644 --- a/deps/v8/test/inspector/cpu-profiler/stop-without-preceeding-start.js +++ b/deps/v8/test/inspector/cpu-profiler/stop-without-preceeding-start.js @@ -2,11 +2,25 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -InspectorTest.log("Test that profiler doesn't crash when we call stop without preceeding start."); +let {session, contextGroup, Protocol} = InspectorTest.start("Test that profiler doesn't crash when we call stop without preceeding start."); Protocol.Profiler.stop().then(didStopProfile); function didStopProfile(messageObject) { - InspectorTest.expectedError("ProfileAgent.stop", messageObject); + expectedError("ProfileAgent.stop", messageObject); InspectorTest.completeTest(); } + +function checkExpectation(fail, name, messageObject) +{ + if (fail === !!messageObject.error) { + InspectorTest.log("PASS: " + name); + return true; + } + + InspectorTest.log("FAIL: " + name + ": " + JSON.stringify(messageObject)); + InspectorTest.completeTest(); + return false; +} +var expectedSuccess = checkExpectation.bind(null, false); +var expectedError = checkExpectation.bind(null, true); |