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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/page/frameAttachedStacktrace.js

Issue 2942573003: [DevTools] New harness for inspector-protocol layout tests (Closed)
Patch Set: unified Created 3 years, 6 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
(Empty)
1 (async function() {
2 let {page, session, Protocol} = await InspectorTest.startURL('../resources/fra me-attached-stacktrace-page.html', '');
3
4 const expectedNumberOfFrames = 3;
5 var currentFrameCount = 0;
6
7 Protocol.Page.onFrameAttached(data => {
8 currentFrameCount++;
9 InspectorTest.log("Frame Attached");
10 var stack = data.params.stack;
11 if (stack) {
12 logCallframes(stack.callFrames);
13 } else {
14 InspectorTest.log("Stack is empty");
15 InspectorTest.log("");
16 }
17 if (currentFrameCount >= expectedNumberOfFrames) {
18 InspectorTest.completeTest();
19 }
20 });
21
22 Protocol.Page.enable();
23 Protocol.Page.reload({ "ignoreCache": false });
24 await Protocol.Page.onceLoadEventFired();
25 session.evaluate('createFrame()');
26
27 // showUrl left in for debugging reasons.
28 function logCallframes(frames) {
29 InspectorTest.log("Call Frames :");
30 if (!frames) {
31 InspectorTest.log("No callframes");
32 InspectorTest.log("");
33 return;
34 }
35 InspectorTest.log("[");
36 for (var i = 0; i < frames.length; i++) {
37 var frame = frames[i];
38 InspectorTest.log(" [" + i + "] : {");
39 if (!frame) {
40 InspectorTest.log(" No Frame");
41 continue;
42 }
43 var url = frame.url || '';
44 if (url.indexOf('data:') !== 0 && url.indexOf('/') !== -1) {
45 var urlParts = url.split('/');
46 url = "<only showing file name>/" + urlParts[urlParts.length - 1];
47 }
48 InspectorTest.log(" columnNumber : " + frame.columnNumber);
49 InspectorTest.log(" functionName : " + frame.functionName);
50 InspectorTest.log(" lineNumber : " + frame.lineNumber);
51 InspectorTest.log(" scriptId : " + (frame.scriptId ? "<scriptId>" : nul l));
52 InspectorTest.log(" lineNumber : " + frame.lineNumber);
53 InspectorTest.log(" url : " + url);
54 InspectorTest.log(" }");
55 }
56 InspectorTest.log("]");
57 InspectorTest.log("");
58 }
59 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698