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: Added the eslintrc Created June 12, 2017, 1:25 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 } 92 }
93 93
94 // Will ensure the class ElemHideEmulation is loaded. 94 // Will ensure the class ElemHideEmulation is loaded.
95 // NOTE: if it never loads, this will probably hang. 95 // NOTE: if it never loads, this will probably hang.
96 function loadElemHideEmulation() 96 function loadElemHideEmulation()
97 { 97 {
98 if (typeof ElemHideEmulation == "undefined") 98 if (typeof ElemHideEmulation == "undefined")
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(); 105 return loadElemHideEmulation();
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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 let parent = createElementWithStyle("{}"); 612 let parent = createElementWithStyle("{}");
613 let child = createElementWithStyle("{background-color: #000}", parent); 613 let child = createElementWithStyle("{background-color: #000}", parent);
614 applyElemHideEmulation( 614 applyElemHideEmulation(
615 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"] 615 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"]
616 ).then(() => 616 ).then(() =>
617 { 617 {
618 expectVisible(test, child); 618 expectVisible(test, child);
619 expectHidden(test, parent); 619 expectHidden(test, parent);
620 }).catch(unexpectedError.bind(test)).then(() => test.done()); 620 }).catch(unexpectedError.bind(test)).then(() => test.done());
621 }; 621 };
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