diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /layout/style/test/browser_newtab_share_rule_processors.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'layout/style/test/browser_newtab_share_rule_processors.js')
-rw-r--r-- | layout/style/test/browser_newtab_share_rule_processors.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/layout/style/test/browser_newtab_share_rule_processors.js b/layout/style/test/browser_newtab_share_rule_processors.js new file mode 100644 index 000000000..810f5f86e --- /dev/null +++ b/layout/style/test/browser_newtab_share_rule_processors.js @@ -0,0 +1,38 @@ +var theTab; +var theBrowser; + +function listener(evt) { + if (evt.target == theBrowser.contentDocument) { + doTest(); + } +} + +function test() { + waitForExplicitFinish(); + var testURL = getRootDirectory(gTestPath) + "newtab_share_rule_processors.html"; + theTab = gBrowser.addTab(testURL); + theBrowser = gBrowser.getBrowserForTab(theTab); + theBrowser.addEventListener("load", listener, true); +} + +function doTest() { + theBrowser.removeEventListener("load", listener, true); + var winUtils = theBrowser.contentWindow + .QueryInterface(Ci.nsIInterfaceRequestor) + .getInterface(Ci.nsIDOMWindowUtils); + // The initial set of agent-level sheets should have a rule processor that's + // also being used by another document. + ok(winUtils.hasRuleProcessorUsedByMultipleStyleSets(Ci.nsIStyleSheetService.AGENT_SHEET), + "agent sheet rule processor is used by multiple style sets"); + // Document-level sheets currently never get shared rule processors. + ok(!winUtils.hasRuleProcessorUsedByMultipleStyleSets(Ci.nsIStyleSheetService.AUTHOR_SHEET), + "author sheet rule processor is not used by multiple style sets"); + // Adding a unique style sheet to the agent level will cause it to have a + // rule processor that is unique. + theBrowser.contentWindow.wrappedJSObject.addAgentSheet(); + ok(!winUtils.hasRuleProcessorUsedByMultipleStyleSets(Ci.nsIStyleSheetService.AGENT_SHEET), + "agent sheet rule processor is not used by multiple style sets after " + + "having a unique sheet added to it"); + gBrowser.removeTab(theTab); + finish(); +} |