Backed out changeset 4bf7cca192e7 (bug 1485182) for ES linting failure on a CLOSED TREE

This commit is contained in:
shindli 2018-08-22 22:49:43 +03:00
Родитель f91879804f
Коммит a67fd14d8f
4 изменённых файлов: 0 добавлений и 66 удалений

Просмотреть файл

@ -1,6 +1,5 @@
[DEFAULT]
support-files =
embedder.html
head.js
page.html
3rdParty.html
@ -23,7 +22,6 @@ support-files = server.sjs
[browser_existingCookiesForSubresources.js]
[browser_imageCache.js]
support-files = image.sjs
[browser_onModifyRequestNotificationForTrackingResources.js]
[browser_subResources.js]
support-files = subResources.sjs
[browser_script.js]

Просмотреть файл

@ -1,60 +0,0 @@
ChromeUtils.import("resource://gre/modules/Services.jsm");
/**
* This test ensures that http-on-modify-request is dispatched for channels that
* are blocked by tracking protection. It sets up a page with a third-party script
* resource on it that is blocked by TP, and sets up an http-on-modify-request
* observer which waits to be notified about that resource. The test would time out
* if the http-on-modify-request notification isn't dispatched before the channel is
* canceled.
*/
async function onModifyRequest() {
return new Promise((resolve, reject) => {
Services.obs.addObserver(function observer(subject, topic, data) {
let httpChannel = subject.QueryInterface(Ci.nsIHttpChannel);
let spec = httpChannel.URI.spec;
info("Observed channel for " + spec);
if (httpChannel.URI.prePath + "/" != TEST_3RD_PARTY_DOMAIN_TP) {
return;
}
ok(spec.endsWith("empty.js"), "Correct resource observed");
Services.obs.removeObserver(observer, "http-on-modify-request");
resolve();
}, "http-on-modify-request", false);
});
}
add_task(async function() {
info("Starting subResources test");
await SpecialPowers.flushPrefEnv();
await SpecialPowers.pushPrefEnv({"set": [
["browser.contentblocking.enabled", true],
["privacy.trackingprotection.enabled", true],
// the test doesn't open a private window, so we don't care about this pref's value
["privacy.trackingprotection.pbmode.enabled", false],
// tracking annotations aren't needed in this test, only TP is needed
["privacy.trackingprotection.annotate_channels", false],
// prevent the content blocking on-boarding UI to start mid-way through the test!
["privacy.trackingprotection.introCount", ContentBlocking.MAX_INTROS],
]});
await UrlClassifierTestUtils.addTestTrackers();
let promise = onModifyRequest();
info("Creating a new tab");
let tab = BrowserTestUtils.addTab(gBrowser, TEST_EMBEDDER_PAGE);
gBrowser.selectedTab = tab;
let browser = gBrowser.getBrowserForTab(tab);
await BrowserTestUtils.browserLoaded(browser);
await promise;
info("Removing the tab");
BrowserTestUtils.removeTab(tab);
UrlClassifierTestUtils.cleanupTestTrackers();
});

Просмотреть файл

@ -1,2 +0,0 @@
<!DOCTYPE html>
<script src="https://tracking.example.com/browser/toolkit/components/antitracking/test/browser/empty.js"></script>

Просмотреть файл

@ -1,11 +1,9 @@
const TEST_DOMAIN = "http://example.net/";
const TEST_3RD_PARTY_DOMAIN = "https://tracking.example.org/";
const TEST_3RD_PARTY_DOMAIN_TP = "https://tracking.example.com/";
const TEST_PATH = "browser/toolkit/components/antitracking/test/browser/";
const TEST_TOP_PAGE = TEST_DOMAIN + TEST_PATH + "page.html";
const TEST_EMBEDDER_PAGE = TEST_DOMAIN + TEST_PATH + "embedder.html";
const TEST_POPUP_PAGE = TEST_DOMAIN + TEST_PATH + "popup.html";
const TEST_3RD_PARTY_PAGE = TEST_3RD_PARTY_DOMAIN + TEST_PATH + "3rdParty.html";
const TEST_3RD_PARTY_PAGE_WO = TEST_3RD_PARTY_DOMAIN + TEST_PATH + "3rdPartyWO.html";