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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector-protocol/network/websocket-initiator.js

Issue 2961493002: [DevTools] Migrate inspector-protocol/{input,network} tests to new harness (Closed)
Patch Set: 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(testRunner) {
2 let {page, session, dp} = await testRunner.startURL('../resources/websocket-in itiator.html', `Initiator for Websockets check fixes http://crbug.com/457811`);
3
4 function cleanUrl(url) {
5 url = url.match(/\/[^\/]+$/);
6 if (url.length)
7 return url[0].substr(1);
8 return url;
9 }
10
11 testRunner.log('Test started');
12 var messageObject = await dp.Network.enable();
allada 2017/06/26 22:02:54 Lets not check this failure.
dgozman 2017/06/26 23:22:08 Done.
13 if (messageObject.error) {
14 testRunner.fail(`FAIL: Couldn't enable network agent: ${messageObject.error. message}`);
15 return;
16 }
17 testRunner.log('Network agent enabled');
18
19 session.evaluate(`createSocket()`);
20
21 var event = await dp.Network.onceWebSocketCreated();
22 var initiator = event.params.initiator;
23 testRunner.log('');
24 testRunner.log('Initiator Type: ' + initiator.type);
25 for (var i = 0; i < initiator.stack.callFrames.length; ++i) {
allada 2017/06/26 22:02:54 While we are here lets extract initiator.stack.cal
dgozman 2017/06/26 23:22:08 Done.
26 var frame = initiator.stack.callFrames[i];
27 testRunner.log('Stack #' + i);
28 if (frame.lineNumber) {
29 testRunner.log(' functionName: ' + frame.functionName);
30 testRunner.log(' url: ' + cleanUrl(frame.url));
31 testRunner.log(' lineNumber: ' + frame.lineNumber);
32 break;
33 }
34 }
35 testRunner.completeTest();
36 })
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698