haikuwebkit/LayoutTests/inspector/dom/csp-hash-expected.txt

37 lines
1.2 KiB
Plaintext
Raw Permalink Normal View History

Web Inspector: Display Content Security Policy hash in details sidebar for script and style elements https://bugs.webkit.org/show_bug.cgi?id=155466 <rdar://problem/25152480> Reviewed by Joseph Pecoraro and Timothy Hatcher. Source/JavaScriptCore: Add property contentSecurityPolicyHash to store the CSP hash for an HTML style element or an applicable HTML script element. * inspector/protocol/DOM.json: Source/WebCore: For convenience, display the SHA-256 Content Security Policy (CSP) hash in the node details sidebar for the selected HTML script element or HTML style element. A CSP script hash is only applicable to inline JavaScript scripts. Therefore, we will display a hash for HTML script elements only if they do not have a src attribute. Tests: inspector/dom/csp-big5-hash.html inspector/dom/csp-hash.html * inspector/InspectorDOMAgent.cpp: (WebCore::computeContentSecurityPolicySHA256Hash): Added. (WebCore::InspectorDOMAgent::buildObjectForNode): For an applicable HTML script- or style- element, pass the computed SHA-256 CSP hash to the Inspector front end. Source/WebInspectorUI: * Localizations/en.lproj/localizedStrings.js: Add English localized string for the CSP hash UI label. * UserInterface/Models/DOMNode.js: (WebInspector.DOMNode): Initialize the instance variable this._contentSecurityPolicyHash with the value passed from the Inspector back end. (WebInspector.DOMNode.prototype.contentSecurityPolicyHash): Returns the CSP hash for this node. * UserInterface/Views/DOMNodeDetailsSidebarPanel.js: (WebInspector.DOMNodeDetailsSidebarPanel): Append a row to the end of section Identity to display the CSP hash (if applicable). (WebInspector.DOMNodeDetailsSidebarPanel.prototype.refresh): Query the underlying WebInspector.DOMNode for the CSP hash of the selected node. LayoutTests: Add tests to ensure that the WebInspector.DOMNode object associated with an HTML style element or applicable HTML script element has a valid CSP hash. * inspector/dom/csp-big5-hash-expected.txt: Added. * inspector/dom/csp-big5-hash.html: Added. * inspector/dom/csp-hash-expected.txt: Added. * inspector/dom/csp-hash.html: Added. Canonical link: https://commits.webkit.org/173591@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198178 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2016-03-15 00:39:59 +00:00
Test for Content Security Policy hash support on DOM.DOMNode.
PASS: Got DOMNode for #stylesheet-without-whitespace
PASS: DOMNode has hash sha256-NW7+Fm6YV404pkklaopT0jgCBCmfOAn0K+NtIfyPN4A=
PASS: Got DOMNode for #stylesheet-with-whitespace
PASS: DOMNode has hash sha256-b5lOENncCyOGrTlLzIlify6a9ddSaiGTBFF/jcYcj0k=
PASS: Got DOMNode for #stylesheet-with-ignored-charset
PASS: DOMNode has hash sha256-Nyij5I3ne5qy0HQHZD8sKjbedAqMQDJ2riYqGniSYTc=
PASS: Got DOMNode for #script-without-whitespace
PASS: DOMNode has hash sha256-tVRjKJA9OYKEzYP5h7H2XbuSVgOjLD74/zqHyl+/xOM=
PASS: Got DOMNode for #script-with-whitespace
PASS: DOMNode has hash sha256-hSQRzSxNGYtVe272nNs1poXibikReR/Y+NfX6TsCqzo=
PASS: Got DOMNode for #script-with-unicode-code-point-00C5
PASS: DOMNode has hash sha256-YcKgriaBGkU6FsWZXgDLv4Wo5UZ5Qe5hNp6Psb3RJOE=
PASS: Got DOMNode for #script-with-unicode-code-point-212B
PASS: DOMNode has hash sha256-YcKgriaBGkU6FsWZXgDLv4Wo5UZ5Qe5hNp6Psb3RJOE=
PASS: Got DOMNode for #external-stylesheet
PASS: DOMNode has hash undefined
PASS: Got DOMNode for #external-script
PASS: DOMNode has hash undefined
PASS: Got DOMNode for #external-stylesheet
PASS: DOMNode has hash undefined
PASS: Got DOMNode for #paragraph
PASS: DOMNode has hash undefined