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

Unified Diff: chrome/content/tests/policy.js

Issue 6439460933730304: Issue 616 - Add tests for $generichide and $genericblock (Closed)
Patch Set: Addressed The Professor's feedback! Created Oct. 2, 2015, 10:17 a.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 | « chrome/content/tests/matcher.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/tests/policy.js
diff --git a/chrome/content/tests/policy.js b/chrome/content/tests/policy.js
index d977b44850f4a2718fc04d45e971dce7e1e1c259..847a798368b2d22d1b9bdd27e77fce73f1bc78f3 100644
--- a/chrome/content/tests/policy.js
+++ b/chrome/content/tests/policy.js
@@ -297,14 +297,21 @@
{
defaultMatcher.clear();
- if (stage > 1)
+ if (stage == 7)
+ defaultMatcher.add(Filter.fromText(expectedURL + "$domain=127.0.0.1"));
+ else if (stage > 1)
defaultMatcher.add(Filter.fromText(expectedURL));
+
if (stage == 3)
defaultMatcher.add(Filter.fromText("@@||127.0.0.1:1234/test|$document"));
if (stage == 4)
defaultMatcher.add(Filter.fromText("@@||127.0.0.1:1234/test|$~document"));
if (stage == 5)
defaultMatcher.add(Filter.fromText("@@||127.0.0.1:1234/test|$document,sitekey=" + publickey));
+ if (stage == 6 || stage == 7)
+ defaultMatcher.add(Filter.fromText("@@||127.0.0.1:1234/test|$genericblock"));
+ if (stage == 8)
+ defaultMatcher.add(Filter.fromText("@@||127.0.0.1:1234/test|$genericblock,sitekey=" + publickey));
if (!explicitEvent)
{
@@ -367,7 +374,7 @@
equal(policyHits.length, 0, "Number of policy hits");
// We cannot rely on the correctness of policy hits for sitekey filters due to blocking
// filter hits being counted even if the resource doesn't end up getting blocked
- else if (stage != 5)
+ else if (stage != 5 && stage != 6 && stage != 8)
{
equal(policyHits.length, 1, "Number of policy hits");
if (policyHits.length == 1)
@@ -401,7 +408,10 @@
2: "running with filter %S",
3: "running with filter %S and site exception",
4: "running with filter %S and exception not applicable to sites",
- 5: "running with filter %S and sitekey exception"
+ 5: "running with filter %S and sitekey exception",
+ 6: "running with filter %S and $genericblock exception",
+ 7: "running with filter %S$domain=127.0.0.1 and $genericblock exception",
+ 8: "running with filter %S and $genericblock,sitekey exception"
};
for (let test = 0; test < tests.length; test++)
« no previous file with comments | « chrome/content/tests/matcher.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld