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

Side by Side Diff: test/browser/elemHideEmulation.js

Issue 29460576: Issue 5079 - Turn elemHideEmulation into a CommonJS module (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Rebased on master Created Aug. 10, 2017, 2:44 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Pass true when it calls itself. 92 // Pass true when it calls itself.
93 function loadElemHideEmulation(inside) 93 function loadElemHideEmulation(inside)
94 { 94 {
95 if (typeof ElemHideEmulation == "undefined") 95 if (typeof ElemHideEmulation == "undefined")
96 { 96 {
97 if (inside) 97 if (inside)
98 return Promise.reject("Failed to load ElemHideEmulation."); 98 return Promise.reject("Failed to load ElemHideEmulation.");
99 99
100 return loadScript(myUrl + "/../../../lib/common.js").then(() => 100 return loadScript(myUrl + "/../../../lib/common.js").then(() =>
101 { 101 {
102 return loadScript(myUrl + "/../../../chrome/content/elemHideEmulation.js") ; 102 return loadScript(myUrl + "/../../../lib/content/elemHideEmulation.js");
103 }).then(() => 103 }).then(() =>
104 { 104 {
105 return loadElemHideEmulation(true); 105 return loadElemHideEmulation(true);
106 }); 106 });
107 } 107 }
108 108
109 return Promise.resolve(); 109 return Promise.resolve();
110 } 110 }
111 111
112 // Create a new ElemHideEmulation instance with @selectors. 112 // Create a new ElemHideEmulation instance with @selectors.
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 let child = createElementWithStyle("{}", parent); 459 let child = createElementWithStyle("{}", parent);
460 insertStyleRule("body #" + parent.id + " > div { background-color: #000}"); 460 insertStyleRule("body #" + parent.id + " > div { background-color: #000}");
461 applyElemHideEmulation( 461 applyElemHideEmulation(
462 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"] 462 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"]
463 ).then(() => 463 ).then(() =>
464 { 464 {
465 expectVisible(test, child); 465 expectVisible(test, child);
466 expectHidden(test, parent); 466 expectHidden(test, parent);
467 }).catch(unexpectedError.bind(test)).then(() => test.done()); 467 }).catch(unexpectedError.bind(test)).then(() => test.done());
468 }; 468 };
OLDNEW
« lib/content/elemHideEmulation.js ('K') | « lib/content/elemHideEmulation.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld