WebKit Bugzilla
Attachment 368354 Details for
Bug 197325
: Add WKContentRuleList ping resource-type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197325-20190426150015.patch (text/plain), 26.27 KB, created by
Alex Christensen
on 2019-04-26 15:00:16 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Alex Christensen
Created:
2019-04-26 15:00:16 PDT
Size:
26.27 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 244705) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,27 @@ >+2019-04-26 Alex Christensen <achristensen@webkit.org> >+ >+ Add WKContentRuleList ping resource-type >+ https://bugs.webkit.org/show_bug.cgi?id=197325 >+ <rdar://problem/49841404> >+ >+ Reviewed by Geoff Garen. >+ >+ Tests: http/tests/contentextensions/block-ping-resource-type-ping.html and http/tests/contentextensions/block-ping-resource-type-raw.html >+ >+ * contentextensions/ContentExtensionsBackend.cpp: >+ (WebCore::ContentExtensions::ContentExtensionsBackend::processContentRuleListsForLoad): >+ * contentextensions/ContentExtensionsBackend.h: >+ * loader/PingLoader.cpp: >+ (WebCore::processContentRuleListsForLoad): >+ (WebCore::PingLoader::sendPing): >+ * loader/ResourceLoadInfo.cpp: >+ (WebCore::ContentExtensions::readResourceType): >+ (WebCore::ContentExtensions::ResourceLoadInfo::getResourceFlags const): >+ * loader/ResourceLoadInfo.h: >+ * page/UserContentProvider.cpp: >+ (WebCore::UserContentProvider::processContentRuleListsForLoad): >+ * page/UserContentProvider.h: >+ > 2019-04-26 Eric Carlson <eric.carlson@apple.com> > > Create AVFoundationSoftLink.{h,mm} to reduce duplicate code >Index: Source/WebCore/contentextensions/ContentExtensionsBackend.cpp >=================================================================== >--- Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (revision 244694) >+++ Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (working copy) >@@ -150,7 +150,7 @@ StyleSheetContents* ContentExtensionsBac > return contentExtension ? contentExtension->globalDisplayNoneStyleSheet() : nullptr; > } > >-ContentRuleListResults ContentExtensionsBackend::processContentRuleListsForLoad(const URL& url, ResourceType resourceType, DocumentLoader& initiatingDocumentLoader) >+ContentRuleListResults ContentExtensionsBackend::processContentRuleListsForLoad(const URL& url, OptionSet<ResourceType> resourceType, DocumentLoader& initiatingDocumentLoader) > { > if (m_contentExtensions.isEmpty()) > return { }; >Index: Source/WebCore/contentextensions/ContentExtensionsBackend.h >=================================================================== >--- Source/WebCore/contentextensions/ContentExtensionsBackend.h (revision 244695) >+++ Source/WebCore/contentextensions/ContentExtensionsBackend.h (working copy) >@@ -62,7 +62,7 @@ public: > WEBCORE_EXPORT Vector<ActionsFromContentRuleList> actionsForResourceLoad(const ResourceLoadInfo&) const; > WEBCORE_EXPORT StyleSheetContents* globalDisplayNoneStyleSheet(const String& identifier) const; > >- ContentRuleListResults processContentRuleListsForLoad(const URL&, ResourceType, DocumentLoader& initiatingDocumentLoader); >+ ContentRuleListResults processContentRuleListsForLoad(const URL&, OptionSet<ResourceType>, DocumentLoader& initiatingDocumentLoader); > WEBCORE_EXPORT ContentRuleListResults processContentRuleListsForPingLoad(const URL&, const URL& mainDocumentURL); > > static const String& displayNoneCSSRule(); >Index: Source/WebCore/loader/PingLoader.cpp >=================================================================== >--- Source/WebCore/loader/PingLoader.cpp (revision 244697) >+++ Source/WebCore/loader/PingLoader.cpp (working copy) >@@ -61,7 +61,7 @@ namespace WebCore { > #if ENABLE(CONTENT_EXTENSIONS) > > // Returns true if we should block the load. >-static bool processContentRuleListsForLoad(const Frame& frame, ResourceRequest& request, ContentExtensions::ResourceType resourceType) >+static bool processContentRuleListsForLoad(const Frame& frame, ResourceRequest& request, OptionSet<ContentExtensions::ResourceType> resourceType) > { > auto* documentLoader = frame.loader().documentLoader(); > if (!documentLoader) >@@ -117,7 +117,7 @@ void PingLoader::sendPing(Frame& frame, > > ResourceRequest request(pingURL); > #if ENABLE(CONTENT_EXTENSIONS) >- if (processContentRuleListsForLoad(frame, request, ContentExtensions::ResourceType::Raw)) >+ if (processContentRuleListsForLoad(frame, request, { ContentExtensions::ResourceType::Raw, ContentExtensions::ResourceType::Ping })) > return; > #endif > >Index: Source/WebCore/loader/ResourceLoadInfo.cpp >=================================================================== >--- Source/WebCore/loader/ResourceLoadInfo.cpp (revision 244695) >+++ Source/WebCore/loader/ResourceLoadInfo.cpp (working copy) >@@ -101,6 +101,8 @@ uint16_t readResourceType(const String& > return static_cast<uint16_t>(ResourceType::Media); > if (name == "popup") > return static_cast<uint16_t>(ResourceType::Popup); >+ if (name == "ping") >+ return static_cast<uint16_t>(ResourceType::Ping); > return static_cast<uint16_t>(ResourceType::Invalid); > } > >@@ -125,7 +127,7 @@ ResourceFlags ResourceLoadInfo::getResou > { > ResourceFlags flags = 0; > ASSERT(type != ResourceType::Invalid); >- flags |= static_cast<ResourceFlags>(type); >+ flags |= type.toRaw(); > flags |= isThirdParty() ? static_cast<ResourceFlags>(LoadType::ThirdParty) : static_cast<ResourceFlags>(LoadType::FirstParty); > return flags; > } >Index: Source/WebCore/loader/ResourceLoadInfo.h >=================================================================== >--- Source/WebCore/loader/ResourceLoadInfo.h (revision 244695) >+++ Source/WebCore/loader/ResourceLoadInfo.h (working copy) >@@ -28,6 +28,7 @@ > #if ENABLE(CONTENT_EXTENSIONS) > > #include "CachedResource.h" >+#include <wtf/OptionSet.h> > #include <wtf/URL.h> > > namespace WebCore { >@@ -45,8 +46,10 @@ enum class ResourceType : uint16_t { > Media = 0x0080, > PlugInStream = 0x0100, > Popup = 0x0200, >+ // 0x0400 and 0x0800 are used by LoadType. >+ Ping = 0x1000, > }; >-const uint16_t ResourceTypeMask = 0x03FF; >+const uint16_t ResourceTypeMask = 0x13FF; > > enum class LoadType : uint16_t { > Invalid = 0x0000, >@@ -55,6 +58,8 @@ enum class LoadType : uint16_t { > }; > const uint16_t LoadTypeMask = 0x0C00; > >+static_assert(!(ResourceTypeMask & LoadTypeMask), "ResourceTypeMask and LoadTypeMask should be mutually exclusive because they are stored in the same uint16_t"); >+ > typedef uint16_t ResourceFlags; > > // The first 32 bits of a uint64_t action are used for the action location. >@@ -74,7 +79,7 @@ uint16_t readLoadType(const String&); > struct ResourceLoadInfo { > URL resourceURL; > URL mainDocumentURL; >- ResourceType type; >+ OptionSet<ResourceType> type; > > bool isThirdParty() const; > ResourceFlags getResourceFlags() const; >Index: Source/WebCore/page/UserContentProvider.cpp >=================================================================== >--- Source/WebCore/page/UserContentProvider.cpp (revision 244695) >+++ Source/WebCore/page/UserContentProvider.cpp (working copy) >@@ -102,7 +102,7 @@ static bool contentExtensionsEnabled(con > return true; > } > >-ContentRuleListResults UserContentProvider::processContentRuleListsForLoad(const URL& url, ContentExtensions::ResourceType resourceType, DocumentLoader& initiatingDocumentLoader) >+ContentRuleListResults UserContentProvider::processContentRuleListsForLoad(const URL& url, OptionSet<ContentExtensions::ResourceType> resourceType, DocumentLoader& initiatingDocumentLoader) > { > if (!contentExtensionsEnabled(initiatingDocumentLoader)) > return { }; >Index: Source/WebCore/page/UserContentProvider.h >=================================================================== >--- Source/WebCore/page/UserContentProvider.h (revision 244695) >+++ Source/WebCore/page/UserContentProvider.h (working copy) >@@ -88,7 +88,7 @@ public: > #if ENABLE(CONTENT_EXTENSIONS) > // FIXME: These don't really belong here. They should probably bundled up in the ContentExtensionsBackend > // which should always exist. >- ContentRuleListResults processContentRuleListsForLoad(const URL&, ContentExtensions::ResourceType, DocumentLoader& initiatingDocumentLoader); >+ ContentRuleListResults processContentRuleListsForLoad(const URL&, OptionSet<ContentExtensions::ResourceType>, DocumentLoader& initiatingDocumentLoader); > Vector<ContentExtensions::ActionsFromContentRuleList> actionsForResourceLoad(const ContentExtensions::ResourceLoadInfo&, DocumentLoader& initiatingDocumentLoader); > WEBCORE_EXPORT void forEachContentExtension(const Function<void(const String&, ContentExtensions::ContentExtension&)>&, DocumentLoader& initiatingDocumentLoader); > #endif >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 244694) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,18 @@ >+2019-04-26 Alex Christensen <achristensen@webkit.org> >+ >+ Add WKContentRuleList ping resource-type >+ https://bugs.webkit.org/show_bug.cgi?id=197325 >+ <rdar://problem/49841404> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/contentextensions/block-ping-resource-type-raw--expected.txt: Copied from LayoutTests/http/tests/contentextensions/block-ping-expected.txt. >+ * http/tests/contentextensions/block-ping-resource-type-raw.html: Copied from LayoutTests/http/tests/contentextensions/block-ping.html. >+ * http/tests/contentextensions/block-ping-resource-type-raw.html.json: Copied from LayoutTests/http/tests/contentextensions/block-ping.html.json. >+ * http/tests/contentextensions/block-ping-resource-type-ping-expected.txt: Copied from LayoutTests/http/tests/contentextensions/block-ping-expected.txt. >+ * http/tests/contentextensions/block-ping-resource-type-ping.html: Copied from LayoutTests/http/tests/contentextensions/block-ping.html. >+ * http/tests/contentextensions/block-ping-resource-type-ping.html.json: Copied from LayoutTests/http/tests/contentextensions/block-ping.html.json. >+ > 2019-04-26 Said Abou-Hallawa <sabouhallawa@apple.com> > > propertyRegistry() was not overridden for SVGFEFloodElement and SVGFEMergeElement >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt (revision 244694) (from LayoutTests/http/tests/contentextensions/block-ping-expected.txt:244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt (working copy) >@@ -0,0 +1,12 @@ >+CONSOLE MESSAGE: line 34: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping >+This test follows a link with a ping attribute where the ping URL matches a 'block' rule. >+ >+-------- >+Frame: 'link_frame' >+-------- >+Link with ping was clicked. >+ >+-------- >+Frame: 'result_frame' >+-------- >+Ping not received - timed out. >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt (revision 244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping-expected.txt (working copy) >@@ -1,4 +1,5 @@ >-CONSOLE MESSAGE: line 34: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping >+CONSOLE MESSAGE: line 34: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping-resource-type-ping >+ALERT: PASS: successfully loaded ping url with fetch > This test follows a link with a ping attribute where the ping URL matches a 'block' rule. > > -------- >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html (revision 244694) (from LayoutTests/http/tests/contentextensions/block-ping.html:244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html (working copy) >@@ -0,0 +1,57 @@ >+<head> >+<script> >+if (window.testRunner && window.internals) { >+ testRunner.dumpAsText(); >+ testRunner.dumpChildFramesAsText(); >+ internals.settings.setHyperlinkAuditingEnabled(true); >+ testRunner.waitUntilDone(); >+} >+ >+function loadLinkWithPing() { >+ var iframe = document.getElementById("link_frame"); >+ var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; >+ iframeDoc.write('' + >+ '<img src="resources/delete-ping.php?test=contentextensions-block-ping" ' + >+ 'onerror="parent.clickOnLinkWithPing();">' + >+ '<a id="a" ' + >+ 'href="resources/check-ping.html" ' + // check-ping.html calls showPingResult() >+ 'ping="resources/save-ping.php?test=contentextensions-block-ping"> ' + >+ 'Link with ping' + >+ '</a>' >+ >+ ); >+} >+ >+function clickOnLinkWithPing() { >+ var iframe = document.getElementById("link_frame"); >+ var iframeDoc = iframe.contentDocument; >+ if (window.eventSender) { >+ var a = iframeDoc.getElementById("a"); >+ var x = iframe.offsetLeft + a.offsetLeft + 2; >+ var y = iframe.offsetTop + a.offsetTop + 2; >+ eventSender.mouseMoveTo(x, y); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+ } >+} >+ >+function showPingResult() { >+ var iframe = document.getElementById("result_frame"); >+ iframe.onload = function() { >+ if (window.testRunner) { testRunner.notifyDone(); } >+ } >+ iframe.src = "resources/get-ping-data.php?test=contentextensions-block-ping&timeout_ms=1000"; >+ // Why timeout_ms=1000: >+ // To pass the test, the ping shouldn't arrive, so we need to >+ // timeout at some point. We don't have to wait too long because >+ // the console message can tell us whether the ping was blocked. >+} >+</script> >+</head> >+ >+<body onload="loadLinkWithPing();"> >+This test follows a link with a ping attribute where the ping URL matches a 'block' rule. >+<iframe id="link_frame" name="link_frame"><!-- Will contain link with ping --></iframe> >+<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe> >+</body> >+ >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html (revision 244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html (working copy) >@@ -11,11 +11,11 @@ function loadLinkWithPing() { > var iframe = document.getElementById("link_frame"); > var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; > iframeDoc.write('' + >- '<img src="resources/delete-ping.php?test=contentextensions-block-ping" ' + >+ '<img src="resources/delete-ping.php?test=contentextensions-block-ping-resource-type-ping" ' + > 'onerror="parent.clickOnLinkWithPing();">' + > '<a id="a" ' + > 'href="resources/check-ping.html" ' + // check-ping.html calls showPingResult() >- 'ping="resources/save-ping.php?test=contentextensions-block-ping"> ' + >+ 'ping="resources/save-ping.php?test=contentextensions-block-ping-resource-type-ping"> ' + > 'Link with ping' + > '</a>' > >@@ -38,9 +38,14 @@ function clickOnLinkWithPing() { > function showPingResult() { > var iframe = document.getElementById("result_frame"); > iframe.onload = function() { >- if (window.testRunner) { testRunner.notifyDone(); } >+ fetch("resources/save-ping.php?test=contentextensions-block-ping-resource-type-ping").then(()=>{ >+ fetch("resources/delete-ping.php?test=contentextensions-block-ping-resource-type-ping").then(()=>{ >+ alert("PASS: successfully loaded ping url with fetch"); >+ if (window.testRunner) { testRunner.notifyDone(); } >+ }) >+ }).catch(error => { alert("FAIL:" + error); if (window.testRunner) { testRunner.notifyDone(); } }); > } >- iframe.src = "resources/get-ping-data.php?test=contentextensions-block-ping&timeout_ms=1000"; >+ iframe.src = "resources/get-ping-data.php?test=contentextensions-block-ping-resource-type-ping&timeout_ms=1000"; > // Why timeout_ms=1000: > // To pass the test, the ping shouldn't arrive, so we need to > // timeout at some point. We don't have to wait too long because >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json (revision 244694) (from LayoutTests/http/tests/contentextensions/block-ping.html.json:244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json (working copy) >@@ -0,0 +1,10 @@ >+[ >+ { >+ "trigger": { >+ "url-filter": "save-ping.php" >+ }, >+ "action": { >+ "type": "block" >+ } >+ } >+] >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json (revision 244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-ping.html.json (working copy) >@@ -1,7 +1,8 @@ > [ > { > "trigger": { >- "url-filter": "save-ping.php" >+ "url-filter": "save-ping.php", >+ "resource-type": ["ping"] > }, > "action": { > "type": "block" >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt (revision 244694) (from LayoutTests/http/tests/contentextensions/block-ping-expected.txt:244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt (working copy) >@@ -0,0 +1,12 @@ >+CONSOLE MESSAGE: line 34: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping >+This test follows a link with a ping attribute where the ping URL matches a 'block' rule. >+ >+-------- >+Frame: 'link_frame' >+-------- >+Link with ping was clicked. >+ >+-------- >+Frame: 'result_frame' >+-------- >+Ping not received - timed out. >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt (revision 244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw-expected.txt (working copy) >@@ -1,4 +1,8 @@ >-CONSOLE MESSAGE: line 34: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping >+CONSOLE MESSAGE: line 34: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-raw.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw >+CONSOLE MESSAGE: line 41: Content blocker prevented frame displaying http://127.0.0.1:8000/contentextensions/block-ping-resource-type-raw.html from loading a resource from http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw >+CONSOLE MESSAGE: line 41: Resource blocked by content blocker >+CONSOLE MESSAGE: line 41: Fetch API cannot load http://127.0.0.1:8000/contentextensions/resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw due to access control checks. >+ALERT: PASS:TypeError: Resource blocked by content blocker > This test follows a link with a ping attribute where the ping URL matches a 'block' rule. > > -------- >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html (revision 244694) (from LayoutTests/http/tests/contentextensions/block-ping.html:244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html (working copy) >@@ -0,0 +1,57 @@ >+<head> >+<script> >+if (window.testRunner && window.internals) { >+ testRunner.dumpAsText(); >+ testRunner.dumpChildFramesAsText(); >+ internals.settings.setHyperlinkAuditingEnabled(true); >+ testRunner.waitUntilDone(); >+} >+ >+function loadLinkWithPing() { >+ var iframe = document.getElementById("link_frame"); >+ var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; >+ iframeDoc.write('' + >+ '<img src="resources/delete-ping.php?test=contentextensions-block-ping" ' + >+ 'onerror="parent.clickOnLinkWithPing();">' + >+ '<a id="a" ' + >+ 'href="resources/check-ping.html" ' + // check-ping.html calls showPingResult() >+ 'ping="resources/save-ping.php?test=contentextensions-block-ping"> ' + >+ 'Link with ping' + >+ '</a>' >+ >+ ); >+} >+ >+function clickOnLinkWithPing() { >+ var iframe = document.getElementById("link_frame"); >+ var iframeDoc = iframe.contentDocument; >+ if (window.eventSender) { >+ var a = iframeDoc.getElementById("a"); >+ var x = iframe.offsetLeft + a.offsetLeft + 2; >+ var y = iframe.offsetTop + a.offsetTop + 2; >+ eventSender.mouseMoveTo(x, y); >+ eventSender.mouseDown(); >+ eventSender.mouseUp(); >+ } >+} >+ >+function showPingResult() { >+ var iframe = document.getElementById("result_frame"); >+ iframe.onload = function() { >+ if (window.testRunner) { testRunner.notifyDone(); } >+ } >+ iframe.src = "resources/get-ping-data.php?test=contentextensions-block-ping&timeout_ms=1000"; >+ // Why timeout_ms=1000: >+ // To pass the test, the ping shouldn't arrive, so we need to >+ // timeout at some point. We don't have to wait too long because >+ // the console message can tell us whether the ping was blocked. >+} >+</script> >+</head> >+ >+<body onload="loadLinkWithPing();"> >+This test follows a link with a ping attribute where the ping URL matches a 'block' rule. >+<iframe id="link_frame" name="link_frame"><!-- Will contain link with ping --></iframe> >+<iframe id="result_frame" name="result_frame"><!-- Will contain ping data received by server --></iframe> >+</body> >+ >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html (revision 244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html (working copy) >@@ -11,11 +11,11 @@ function loadLinkWithPing() { > var iframe = document.getElementById("link_frame"); > var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; > iframeDoc.write('' + >- '<img src="resources/delete-ping.php?test=contentextensions-block-ping" ' + >+ '<img src="resources/delete-ping.php?test=contentextensions-block-ping-resource-type-raw" ' + > 'onerror="parent.clickOnLinkWithPing();">' + > '<a id="a" ' + > 'href="resources/check-ping.html" ' + // check-ping.html calls showPingResult() >- 'ping="resources/save-ping.php?test=contentextensions-block-ping"> ' + >+ 'ping="resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw"> ' + > 'Link with ping' + > '</a>' > >@@ -38,9 +38,14 @@ function clickOnLinkWithPing() { > function showPingResult() { > var iframe = document.getElementById("result_frame"); > iframe.onload = function() { >- if (window.testRunner) { testRunner.notifyDone(); } >+ fetch("resources/save-ping.php?test=contentextensions-block-ping-resource-type-raw").then(()=>{ >+ fetch("resources/delete-ping.php?test=contentextensions-block-ping-resource-type-raw").then(()=>{ >+ alert("FAIL: successfully loaded ping url with fetch"); >+ if (window.testRunner) { testRunner.notifyDone(); } >+ }) >+ }).catch(error => { alert("PASS:" + error); if (window.testRunner) { testRunner.notifyDone(); } }); > } >- iframe.src = "resources/get-ping-data.php?test=contentextensions-block-ping&timeout_ms=1000"; >+ iframe.src = "resources/get-ping-data.php?test=contentextensions-block-ping-resource-type-raw&timeout_ms=1000"; > // Why timeout_ms=1000: > // To pass the test, the ping shouldn't arrive, so we need to > // timeout at some point. We don't have to wait too long because >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json (revision 244694) (from LayoutTests/http/tests/contentextensions/block-ping.html.json:244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json (working copy) >@@ -0,0 +1,10 @@ >+[ >+ { >+ "trigger": { >+ "url-filter": "save-ping.php" >+ }, >+ "action": { >+ "type": "block" >+ } >+ } >+] >Index: LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json >=================================================================== >--- LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json (revision 244694) >+++ LayoutTests/http/tests/contentextensions/block-ping-resource-type-raw.html.json (working copy) >@@ -1,7 +1,8 @@ > [ > { > "trigger": { >- "url-filter": "save-ping.php" >+ "url-filter": "save-ping.php", >+ "resource-type": ["raw"] > }, > "action": { > "type": "block"
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
commit-queue
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197325
:
368349
| 368354