OLD | NEW |
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 Loading... |
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 Loading... |
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 }; |
OLD | NEW |