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: Rebased onto typeMask changes Created July 14, 2015, 4:45 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 | « 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 4c0a023be20a351f2532266573e51fd31e621f0c..5784ea1341c14e237cd66ab6d67c31363bfab13a 100644
--- a/chrome/content/tests/policy.js
+++ b/chrome/content/tests/policy.js
@@ -297,13 +297,19 @@
defaultMatcher.clear();
if (stage > 1)
- defaultMatcher.add(Filter.fromText(expectedURL));
+ if (stage == 7)
+ defaultMatcher.add(Filter.fromText(expectedURL + "$domain=127.0.0.1"));
+ else
+ 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 (!explicitEvent)
{
@@ -361,7 +367,7 @@
var callback = function()
{
let expectedStatus = "allowed";
- if (stage == 3)
+ if (stage == 3 || stage == 6)
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
@@ -399,7 +405,9 @@
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"
};
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