Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use events from PW for network data #372

Merged
merged 8 commits into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -219,32 +219,3 @@ This product relies on `expect`
*
*/
---------------------------------------------------------------------------
This product relies on `ChromeDevTools/devtools-frontend`

// Copyright 2014 The Chromium Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66 changes: 11 additions & 55 deletions __tests__/fixtures/networkinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,13 @@ export const NETWORK_INFO: Array<Partial<NetworkInfo>> = [
url: 'https://vigneshh.in/',
method: 'GET',
headers: {
'Upgrade-Insecure-Requests': '1',
'User-Agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/90.0.4392.0 Safari/537.36',
'upgrade-insecure-requests': '1',
':method': 'GET',
':path': '/',
'user-agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/90.0.4392.0 Safari/537.36',
'accept-encoding': 'gzip, deflate, br',
},
mixedContentType: 'none',
initialPriority: 'VeryHigh',
referrerPolicy: 'strict-origin-when-cross-origin',
},
type: 'Document',
method: 'GET',
Expand All @@ -61,41 +56,24 @@ export const NETWORK_INFO: Array<Partial<NetworkInfo>> = [
response: {
url: 'https://vigneshh.in/',
headers: {},
status: 200,
statusCode: 200,
statusText: '',
mimeType: 'text/html',
connectionReused: false,
connectionId: 12,
remoteIPAddress: '[2606:4700:3035::ac43:83e0]',
remotePort: 443,
fromDiskCache: false,
fromServiceWorker: false,
fromPrefetchCache: false,
encodedDataLength: 3329,
responseTime: 1612482095476.922,
protocol: 'h2',
securityState: 'secure',
securityDetails: {
protocol: 'TLS 1.3',
keyExchange: '',
keyExchangeGroup: 'X25519',
cipher: 'AES_128_GCM',
certificateId: 0,
subjectName: 'sni.cloudflaressl.com',
sanList: [],
issuer: 'Cloudflare Inc ECC CA-3',
validFrom: 1595980800,
validTo: 1627560000,
signedCertificateTimestampList: [],
certificateTransparencyCompliance: 'unknown',
},
},
transferSize: 3392,
resourceSize: 7634,
timings: {
blocked: 2.080999780446291,
queueing: 2.145999576896429,
proxy: -1,
dns: 45.81400007009506,
ssl: 61.003000009804964,
connect: 78.5130001604557,
Expand All @@ -116,14 +94,12 @@ export const NETWORK_INFO: Array<Partial<NetworkInfo>> = [
request: {
url: 'https://vigneshh.in/static/main.js',
method: 'GET',
referrer: 'https://vigneshh.in/',
headers: {
Referer: 'https://vigneshh.in/',
'User-Agent':
referer: 'https://vigneshh.in/',
'user-agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/90.0.4392.0 Safari/537.36',
},
mixedContentType: 'none',
initialPriority: 'Low',
referrerPolicy: 'strict-origin-when-cross-origin',
},
type: 'Script',
method: 'GET',
Expand All @@ -134,40 +110,23 @@ export const NETWORK_INFO: Array<Partial<NetworkInfo>> = [
responseReceivedTime: 2355505.603987,
response: {
url: 'https://vigneshh.in/static/main.js',
status: 200,
statusCode: 200,
statusText: '',
headers: {},
mimeType: 'application/javascript',
connectionReused: true,
connectionId: 12,
remoteIPAddress: '[2606:4700:3035::ac43:83e0]',
remotePort: 443,
fromDiskCache: false,
fromServiceWorker: false,
fromPrefetchCache: false,
encodedDataLength: 425,
responseTime: 1612482095622.864,
protocol: 'h2',
securityState: 'secure',
securityDetails: {
protocol: 'TLS 1.3',
keyExchange: '',
keyExchangeGroup: 'X25519',
cipher: 'AES_128_GCM',
certificateId: 0,
subjectName: 'sni.cloudflaressl.com',
sanList: [],
issuer: 'Cloudflare Inc ECC CA-3',
validFrom: 1595980800,
validTo: 1627560000,
signedCertificateTimestampList: [],
certificateTransparencyCompliance: 'unknown',
},
},
timings: {
blocked: 1.058999914675951,
queueing: 46.335999853909016,
proxy: -1,
dns: -1,
ssl: -1,
connect: -1,
Expand All @@ -184,16 +143,13 @@ export const NETWORK_INFO: Array<Partial<NetworkInfo>> = [
request: {
url: 'https://www.google-analytics.com/',
method: 'POST',
referrer: 'https://vigneshh.in/',
headers: {
Referer: 'https://vigneshh.in/',
'User-Agent':
referer: 'https://vigneshh.in/',
'user-agent':
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/90.0.4392.0 Safari/537.36',
'Content-Type': 'text/plain',
'content-type': 'text/plain',
},
hasPostData: true,
mixedContentType: 'none',
initialPriority: 'High',
referrerPolicy: 'strict-origin-when-cross-origin',
},
type: 'XHR',
method: 'POST',
Expand All @@ -202,7 +158,7 @@ export const NETWORK_INFO: Array<Partial<NetworkInfo>> = [
status: 0,
loadEndTime: -1,
responseReceivedTime: -1,
response: null,
response: undefined,
timings: null,
},
];
Loading