Web Inspector: Network - HAR Import
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2019 18:27:08 +0000 (18:27 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Mar 2019 18:27:08 +0000 (18:27 +0000)
commitd4df2328920e0e6d22b56439f960b4f47ef9d619
treedd3a7d2643f1d13b956eb0606bd89c28eeaf8575
parenta6f22bb6c054b5d24fc969d537ccca6e162b129c
Web Inspector: Network - HAR Import
https://bugs.webkit.org/show_bug.cgi?id=195642
<rdar://problem/34820974>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js
* UserInterface/Test.html:
* UserInterface/Test.html:
New strings and resources.

* UserInterface/Controllers/HARBuilder.js:
(WI.HARBuilder.dateFromHARDate):
(WI.HARBuilder.protocolFromHARProtocol):
(WI.HARBuilder.responseSourceFromHARFetchType):
Reverse parsers from HAR to WI.Resource types.

* UserInterface/Models/LocalResource.js: Added.
(WI.LocalResource):
(WI.LocalResource.headersArrayToHeadersObject):
(WI.LocalResource.fromHAREntry):
(WI.LocalResource.prototype.hasContent):
(WI.LocalResource.prototype.setContent):
(WI.LocalResource.prototype.requestContentFromBackend):
A Resource subclass with data fully supplied in the frontend.

* UserInterface/Controllers/NetworkManager.js:
(WI.NetworkManager):
(WI.NetworkManager.synthesizeImportError):
(WI.NetworkManager.prototype.localResourceForURL):
(WI.NetworkManager.prototype.processHAR):
Process a HAR and extract local resources.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView):
(WI.NetworkTableContentView.prototype.reset):
(WI.NetworkTableContentView.prototype._handleResourceAdded):
(WI.NetworkTableContentView.prototype._importHAR):
Add an import button. When an import succeeds reset the
table and only show imported resources (ignoring page
loaded resources).

LayoutTests:

* http/tests/inspector/network/har/har-import-expected.txt: Added.
* http/tests/inspector/network/har/har-import.html: Added.
HAR import tests.

* http/tests/inspector/network/har/resources/bad-version.har: Added.
* http/tests/inspector/network/har/resources/basic.har: Added.
* http/tests/inspector/network/har/resources/empty.har: Added.
* http/tests/inspector/network/har/resources/webkit.org.har: Added.
Sample HARs to test against.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242948 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/inspector/network/har/har-import-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/har/har-import.html [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/har/resources/bad-version.har [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/har/resources/basic.har [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/har/resources/empty.har [new file with mode: 0644]
LayoutTests/http/tests/inspector/network/har/resources/webkit.org.har [new file with mode: 0644]
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/HARBuilder.js
Source/WebInspectorUI/UserInterface/Controllers/NetworkManager.js
Source/WebInspectorUI/UserInterface/Main.html
Source/WebInspectorUI/UserInterface/Models/LocalResource.js [new file with mode: 0644]
Source/WebInspectorUI/UserInterface/Test.html
Source/WebInspectorUI/UserInterface/Views/NetworkTableContentView.js