Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/abp2blocklist.js

Issue 29349790: Issue 4326 - || should match subdomains too (Closed)
Patch Set: Created Aug. 12, 2016, 2:31 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/abp2blocklist.js
diff --git a/test/abp2blocklist.js b/test/abp2blocklist.js
index adf3fb6f23ab0dbff17f3034636a3b1841810411..fbc4f7d752cae60a9c520c1ff2b886a5b25ebd2a 100644
--- a/test/abp2blocklist.js
+++ b/test/abp2blocklist.js
@@ -73,7 +73,7 @@ exports.generateRules = {
"resource-type": ["image", "style-sheet", "script", "font",
"media", "raw", "document"]},
action: {type: "block"}},
- {trigger: {"url-filter": "^https?://test\\.com",
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?test\\.com",
"url-filter-is-case-sensitive": true,
"resource-type": ["image", "style-sheet", "script", "font",
"media", "raw", "document"]},
@@ -84,6 +84,16 @@ exports.generateRules = {
action: {type: "block"}}
]);
+ testRules(test, ["||example.com"], [
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com",
+ "url-filter-is-case-sensitive": true,
+ "resource-type": ["image", "style-sheet", "script", "font",
+ "media", "raw", "document"]},
+
+ action: {type: "block"}}
+ ]);
+
+
test.done();
},
@@ -96,6 +106,14 @@ exports.generateRules = {
action: {type: "ignore-previous-rules"}}
]);
+ testRules(test, ["@@||example.com"], [
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com",
+ "url-filter-is-case-sensitive": true,
+ "resource-type": ["image", "style-sheet", "script", "font",
+ "media", "raw", "document"]},
+ action: {type: "ignore-previous-rules"}}
+ ]);
+
test.done();
},
@@ -120,13 +138,13 @@ exports.generateRules = {
{trigger: {"url-filter": ".*",
"if-domain": ["example.com", "www.example.com"]},
action: {type: "ignore-previous-rules"}},
- {trigger: {"url-filter": "^https?://example\\.com",
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com",
"url-filter-is-case-sensitive": true,
"resource-type": ["image"]},
action: {type: "ignore-previous-rules"}}
]);
testRules(test, ["@@||example.com/path^$font,document"], [
- {trigger: {"url-filter": "^https?://example\\.com/path",
+ {trigger: {"url-filter": "^https?://([^/]+\\.)?example\\.com/path",
"resource-type": ["font"]},
action: {type: "ignore-previous-rules"}}
]);
« no previous file with comments | « lib/abp2blocklist.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld