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

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

Issue 29493648: Issue 5436 - Allow relative selectors in :-abp-has() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Forgot a small cleanup change Created July 20, 2017, 7:21 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 expectVisible(test, sibling2); 382 expectVisible(test, sibling2);
383 expectHidden(test, toHide); 383 expectHidden(test, toHide);
384 }).catch(unexpectedError.bind(test)).then(() => test.done()); 384 }).catch(unexpectedError.bind(test)).then(() => test.done());
385 } 385 }
386 386
387 exports.testPseudoClassHasSelectorWithHasAndWithSuffixSibling = function(test) 387 exports.testPseudoClassHasSelectorWithHasAndWithSuffixSibling = function(test)
388 { 388 {
389 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(test, "div:-abp-has(: -abp-has(div.inside)) + div > div"); 389 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(test, "div:-abp-has(: -abp-has(div.inside)) + div > div");
390 }; 390 };
391 391
392 exports.testPseudoClassHasSelectorWithHasAndWithSuffixSibling2 = function(test)
393 {
394 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(test, "div:-abp-has(: -abp-has(> div.inside)) + div > div");
Wladimir Palant 2017/08/10 13:39:47 It's probably a good idea to test whether :scope a
Wladimir Palant 2017/08/10 13:42:17 Sorry, that should rather be "div:-abp-has(> body
hub 2017/08/14 14:25:32 Done.
395 };
hub 2017/07/20 19:21:42 This is the test that was removed as it failed.
396
392 exports.testPseudoClassHasSelectorWithPropSelector = function(test) 397 exports.testPseudoClassHasSelectorWithPropSelector = function(test)
393 { 398 {
394 let parent = createElementWithStyle("{}"); 399 let parent = createElementWithStyle("{}");
395 let child = createElementWithStyle("{background-color: #000}", parent); 400 let child = createElementWithStyle("{background-color: #000}", parent);
396 applyElemHideEmulation( 401 applyElemHideEmulation(
397 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"] 402 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"]
398 ).then(() => 403 ).then(() =>
399 { 404 {
400 expectVisible(test, child); 405 expectVisible(test, child);
401 expectHidden(test, parent); 406 expectHidden(test, parent);
402 }).catch(unexpectedError.bind(test)).then(() => test.done()); 407 }).catch(unexpectedError.bind(test)).then(() => test.done());
403 }; 408 };
404 409
405 exports.testPseudoClassHasSelectorWithPropSelector2 = function(test) 410 exports.testPseudoClassHasSelectorWithPropSelector2 = function(test)
406 { 411 {
407 let parent = createElementWithStyle("{}"); 412 let parent = createElementWithStyle("{}");
408 let child = createElementWithStyle("{}", parent); 413 let child = createElementWithStyle("{}", parent);
409 insertStyleRule("body #" + parent.id + " > div { background-color: #000}"); 414 insertStyleRule("body #" + parent.id + " > div { background-color: #000}");
410 applyElemHideEmulation( 415 applyElemHideEmulation(
411 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"] 416 ["div:-abp-has(:-abp-properties(background-color: rgb(0, 0, 0)))"]
412 ).then(() => 417 ).then(() =>
413 { 418 {
414 expectVisible(test, child); 419 expectVisible(test, child);
415 expectHidden(test, parent); 420 expectHidden(test, parent);
416 }).catch(unexpectedError.bind(test)).then(() => test.done()); 421 }).catch(unexpectedError.bind(test)).then(() => test.done());
417 }; 422 };
OLDNEW
« chrome/content/elemHideEmulation.js ('K') | « chrome/content/elemHideEmulation.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld