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

Unified Diff: qunit/tests/cssEscaping.js

Issue 6174977720057856: Issue 1853 - Moved filter generation into background page (Closed)
Patch Set: Rebased and fixed documentation mistakenly indicating arguments as optional Created Feb. 28, 2015, 5:59 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 | « metadata.common ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: qunit/tests/cssEscaping.js
===================================================================
--- a/qunit/tests/cssEscaping.js
+++ b/qunit/tests/cssEscaping.js
@@ -4,35 +4,14 @@
var Filter = filterClasses.Filter;
var ElemHideFilter = filterClasses.ElemHideFilter;
- module(
- "CSS escaping",
- {
- setup: function()
- {
- var frame = document.createElement("iframe");
- frame.srcdoc = '<script src="../include.postload.js"></script>';
+ var filterComposer = require("filterComposer");
+ var escapeCSS = filterComposer.escapeCSS;
+ var quoteCSS = filterComposer.quoteCSS;
- stop();
- frame.addEventListener("load", function()
- {
- start();
-
- this.escapeCSS = frame.contentWindow.escapeCSS;
- this.quote = frame.contentWindow.quote;
-
- document.body.removeChild(frame);
- }.bind(this));
-
- document.body.appendChild(frame);
- }
- }
- );
+ module("CSS escaping");
test("CSS escaping", function()
{
- var escapeCSS = this.escapeCSS;
- var quote = this.quote;
-
function testSelector(opts)
{
var mustMatch = opts.mustMatch !== false;
@@ -103,7 +82,7 @@
});
testSelector({
- selector: "[foo=" + quote(s) + "]",
+ selector: "[foo=" + quoteCSS(s) + "]",
attributes: {foo: s}
});
}
« no previous file with comments | « metadata.common ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld