From ac54284832aa697dab4c80af9456a97506b464b2 Mon Sep 17 00:00:00 2001 From: Liang-Heng Chen Date: Thu, 13 Sep 2018 21:27:54 +0000 Subject: [PATCH] Bug 1477046 - Part 1: Add basic FastBlock automation tests; r=mayhemer Basic parts of FastBlock tests, no iframe/xhr tests in this patch. Differential Revision: https://phabricator.services.mozilla.com/D4655 --HG-- extra : moz-landing-system : lando --- netwerk/protocol/http/nsHttpChannel.cpp | 2 +- .../url-classifier/tests/mochitest/chrome.ini | 2 + .../tests/mochitest/fastblock.html | 18 + .../mochitest/test_fastblock_bug1477046.html | 334 ++++++++++++++++++ 4 files changed, 355 insertions(+), 1 deletion(-) create mode 100644 toolkit/components/url-classifier/tests/mochitest/fastblock.html create mode 100644 toolkit/components/url-classifier/tests/mochitest/test_fastblock_bug1477046.html diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index 075ad329a168..e3899d27f7cc 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -759,7 +759,7 @@ nsHttpChannel::ConnectOnTailUnblock() if (isTrackingResource && CheckFastBlocked()) { AntiTrackingCommon::NotifyRejection(this, nsIWebProgressListener::STATE_BLOCKED_SLOW_TRACKING_CONTENT); - Unused << AsyncAbort(NS_ERROR_ABORT); + Unused << AsyncAbort(NS_ERROR_TRACKING_ANNOTATION_URI); CloseCacheEntry(false); return NS_OK; } diff --git a/toolkit/components/url-classifier/tests/mochitest/chrome.ini b/toolkit/components/url-classifier/tests/mochitest/chrome.ini index bb411ddcd907..090cacbf327d 100644 --- a/toolkit/components/url-classifier/tests/mochitest/chrome.ini +++ b/toolkit/components/url-classifier/tests/mochitest/chrome.ini @@ -12,6 +12,7 @@ support-files = classifierHelper.js head.js threathit.sjs + fastblock.html !/toolkit/components/url-classifier/tests/mochitest/classifierFrame.html !/toolkit/components/url-classifier/tests/mochitest/cleanWorker.js !/toolkit/components/url-classifier/tests/mochitest/good.js @@ -65,3 +66,4 @@ skip-if = verify [test_advisory_link.html] [test_threathit_report.html] skip-if = verify +[test_fastblock_bug1477046.html] diff --git a/toolkit/components/url-classifier/tests/mochitest/fastblock.html b/toolkit/components/url-classifier/tests/mochitest/fastblock.html new file mode 100644 index 000000000000..a2555ec305d3 --- /dev/null +++ b/toolkit/components/url-classifier/tests/mochitest/fastblock.html @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/toolkit/components/url-classifier/tests/mochitest/test_fastblock_bug1477046.html b/toolkit/components/url-classifier/tests/mochitest/test_fastblock_bug1477046.html new file mode 100644 index 000000000000..69403b78e39b --- /dev/null +++ b/toolkit/components/url-classifier/tests/mochitest/test_fastblock_bug1477046.html @@ -0,0 +1,334 @@ + + + + + + Test for Bug 1477046 + + + + + + +

+ +
+
+
+
+
+
+ +