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

Side by Side Diff: test/inspector/cpu-profiler/console-profile.js

Issue 2713023004: [inspector] added reconnect method for tests (Closed)
Patch Set: rebased Created 3 years, 9 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 print("Tests that console.profile/profileEnd will record CPU profile when inspec tor front-end is connected."); 5 InspectorTest.log("Tests that console.profile/profileEnd will record CPU profile when inspector front-end is connected.");
6 6
7 InspectorTest.addScript(` 7 InspectorTest.addScript(`
8 function collectProfiles() 8 function collectProfiles()
9 { 9 {
10 console.profile("outer"); 10 console.profile("outer");
11 console.profile(42); 11 console.profile(42);
12 console.profileEnd("outer"); 12 console.profileEnd("outer");
13 console.profileEnd(42); 13 console.profileEnd(42);
14 }`); 14 }`);
15 15
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 if (!findFunctionInProfile(profile.nodes, "collectProfiles")) 50 if (!findFunctionInProfile(profile.nodes, "collectProfiles"))
51 return InspectorTest.fail("collectProfiles function not found in the profile : " + JSON.stringify(profile, null, 4)); 51 return InspectorTest.fail("collectProfiles function not found in the profile : " + JSON.stringify(profile, null, 4));
52 InspectorTest.log("SUCCESS: found 'collectProfiles' function in the profile"); 52 InspectorTest.log("SUCCESS: found 'collectProfiles' function in the profile");
53 InspectorTest.completeTest(); 53 InspectorTest.completeTest();
54 } 54 }
55 55
56 function findFunctionInProfile(nodes, functionName) 56 function findFunctionInProfile(nodes, functionName)
57 { 57 {
58 return nodes.some(n => n.callFrame.functionName === functionName); 58 return nodes.some(n => n.callFrame.functionName === functionName);
59 } 59 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698