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

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

Issue 30035555: Issue 7428, 7400 - Add test case for nested :-abp-properties() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Remove span from test case Created April 3, 2019, 6:52 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 middile: true, 522 middile: true,
523 inside: true, 523 inside: true,
524 sibling: true, 524 sibling: true,
525 sibling2: true, 525 sibling2: true,
526 toHide: true 526 toHide: true
527 }; 527 };
528 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling( 528 runTestPseudoClassHasSelectorWithHasAndWithSuffixSibling(
529 test, "div:-abp-has(> span:-abp-contains(Advertisment))", expectations); 529 test, "div:-abp-has(> span:-abp-contains(Advertisment))", expectations);
530 }; 530 };
531 531
532 // See issue https://issues.adblockplus.org/ticket/7359
Manish Jethani 2019/04/03 18:56:19 Shouldn't these rather be moved to the individual
533 // and issue https://issues.adblockplus.org/ticket/7428
534 async function runTestQualifier(test, selector)
535 {
536 testDocument.body.innerHTML = `
537 <style>
538 span::before {
539 content: "any";
540 }
541 </style>
542 <div id="toHide">
543 <a>
544 <p>
545 <span></span>
546 </p>
547 </a>
548 </div>`;
549
550 if (await applyElemHideEmulation(test, [selector]))
551 expectHidden(test, testDocument.getElementById("toHide"));
552
553 test.done();
554 }
555
556 exports.testPropertySelectorCombinatorQualifier = function(test)
557 {
558 runTestQualifier(
Manish Jethani 2019/04/03 18:56:19 We could reference 7428 here.
hub 2019/04/03 19:57:40 Done.
559 test,
560 "div:-abp-has(> a p > :-abp-properties(content: \"any\"))"
561 );
562 };
563
564 exports.testPropertySelectorCombinatorQualifierNested = function(test)
565 {
566 runTestQualifier(
Manish Jethani 2019/04/03 18:56:19 We could reference 7359 here.
hub 2019/04/03 19:57:40 Done.
567 test,
568 "div:-abp-has(> a p:-abp-has(> :-abp-properties(content: \"any\")))"
569 );
570 };
571
572 // See issue https://issues.adblockplus.org/ticket/7400
573 exports.testPropertySelectorIdenticalTypeQualifier = function(test)
574 {
575 runTestQualifier(
576 test,
577 "div:-abp-has(span:-abp-properties(content: \"any\"))"
578 );
579 };
580
581 // See issue https://issues.adblockplus.org/ticket/7400
582 exports.testPropertySelectorIdenticalTypeQualifierNested = function(test)
583 {
584 runTestQualifier(
585 test,
586 "div:-abp-has(p:-abp-has(span:-abp-properties(content: \"any\")))"
587 );
588 };
589
532 async function runTestPseudoClassContains(test, selector, expectations) 590 async function runTestPseudoClassContains(test, selector, expectations)
533 { 591 {
534 testDocument.body.innerHTML = `<div id="parent"> 592 testDocument.body.innerHTML = `<div id="parent">
535 <div id="middle"> 593 <div id="middle">
536 <div id="middle1"><div id="inside" class="inside"></div></div> 594 <div id="middle1"><div id="inside" class="inside"></div></div>
537 </div> 595 </div>
538 <div id="sibling"> 596 <div id="sibling">
539 <div id="tohide">to hide \ud83d\ude42!</div> 597 <div id="tohide">to hide \ud83d\ude42!</div>
540 </div> 598 </div>
541 <div id="sibling2"> 599 <div id="sibling2">
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1065 { 1123 {
1066 if (element.id == "n2" || element.id == "n2_3") 1124 if (element.id == "n2" || element.id == "n2_3")
1067 expectProcessed(test, element, element.id); 1125 expectProcessed(test, element, element.id);
1068 else 1126 else
1069 expectNotProcessed(test, element, element.id); 1127 expectNotProcessed(test, element, element.id);
1070 } 1128 }
1071 } 1129 }
1072 1130
1073 test.done(); 1131 test.done();
1074 }; 1132 };
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld