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

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

Issue 2947303002: [DevTools] Migrate inspector-protocol/{page,dom-snapshot} tests to new harness (Closed)
Patch Set: rebased Created 3 years, 5 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(testRunner) {
2 let {page, session, dp} = await testRunner.startURL('../resources/frame-attach ed-stacktrace-page.html', '');
3
4 const expectedNumberOfFrames = 3;
5 var currentFrameCount = 0;
6
7 dp.Page.onFrameAttached(data => {
8 currentFrameCount++;
9 testRunner.log("Frame Attached");
10 var stack = data.params.stack;
11 if (stack) {
12 logCallframes(stack.callFrames);
13 } else {
14 testRunner.log("Stack is empty");
15 testRunner.log("");
16 }
17 if (currentFrameCount >= expectedNumberOfFrames) {
18 testRunner.completeTest();
19 }
20 });
21
22 dp.Page.enable();
23 dp.Page.reload({ "ignoreCache": false });
24 await dp.Page.onceLoadEventFired();
25 session.evaluate('createFrame()');
26
27 // showUrl left in for debugging reasons.
28 function logCallframes(frames) {
29 testRunner.log("Call Frames :");
30 if (!frames) {
31 testRunner.log("No callframes");
32 testRunner.log("");
33 return;
34 }
35 testRunner.log("[");
36 for (var i = 0; i < frames.length; i++) {
37 var frame = frames[i];
38 testRunner.log(" [" + i + "] : {");
39 if (!frame) {
40 testRunner.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 testRunner.log(" columnNumber : " + frame.columnNumber);
49 testRunner.log(" functionName : " + frame.functionName);
50 testRunner.log(" lineNumber : " + frame.lineNumber);
51 testRunner.log(" scriptId : " + (frame.scriptId ? "<scriptId>" : null)) ;
52 testRunner.log(" lineNumber : " + frame.lineNumber);
53 testRunner.log(" url : " + url);
54 testRunner.log(" }");
55 }
56 testRunner.log("]");
57 testRunner.log("");
58 }
59 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698