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

Delta Between Two Patch Sets: test/browser/elemHideEmulation.js

Issue 30035555: Issue 7428, 7400 - Add test case for nested :-abp-properties() (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Left Patch Set: Rebase Created April 3, 2019, 6:01 p.m.
Right Patch Set: Moved comments Created April 3, 2019, 7:57 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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
533 // and issue https://issues.adblockplus.org/ticket/7428
534 async function runTestQualifier(test, selector) 532 async function runTestQualifier(test, selector)
535 { 533 {
536 testDocument.body.innerHTML = ` 534 testDocument.body.innerHTML = `
537 <style> 535 <style>
538 span::before { 536 span::before {
539 content: "any"; 537 content: "any";
540 } 538 }
541 </style> 539 </style>
542 <div id="toHide"> 540 <div id="toHide">
543 <a> 541 <a>
544 <p> 542 <p>
545 <span></span> 543 <span></span>
546 </p> 544 </p>
547 </a> 545 </a>
548 </div>`; 546 </div>`;
549 547
550 if (await applyElemHideEmulation(test, [selector])) 548 if (await applyElemHideEmulation(test, [selector]))
551 expectHidden(test, testDocument.getElementById("toHide")); 549 expectHidden(test, testDocument.getElementById("toHide"));
552 550
553 test.done(); 551 test.done();
554 } 552 }
555 553
554 // See issue https://issues.adblockplus.org/ticket/7428
556 exports.testPropertySelectorCombinatorQualifier = function(test) 555 exports.testPropertySelectorCombinatorQualifier = function(test)
557 { 556 {
558 runTestQualifier( 557 runTestQualifier(
559 test, 558 test,
560 "div:-abp-has(> a p > :-abp-properties(content: \"any\"))" 559 "div:-abp-has(> a p > :-abp-properties(content: \"any\"))"
561 ); 560 );
562 }; 561 };
563 562
563 // See issue https://issues.adblockplus.org/ticket/7359
564 exports.testPropertySelectorCombinatorQualifierNested = function(test) 564 exports.testPropertySelectorCombinatorQualifierNested = function(test)
565 { 565 {
566 runTestQualifier( 566 runTestQualifier(
567 test, 567 test,
568 "div:-abp-has(> a p:-abp-has(> span:-abp-properties(content: \"any\")))" 568 "div:-abp-has(> a p:-abp-has(> :-abp-properties(content: \"any\")))"
Manish Jethani 2019/04/03 18:37:40 Thanks for rebasing, it is looking good now, but s
hub 2019/04/03 18:53:20 Done.
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\")))"
569 ); 587 );
570 }; 588 };
571 589
572 async function runTestPseudoClassContains(test, selector, expectations) 590 async function runTestPseudoClassContains(test, selector, expectations)
573 { 591 {
574 testDocument.body.innerHTML = `<div id="parent"> 592 testDocument.body.innerHTML = `<div id="parent">
575 <div id="middle"> 593 <div id="middle">
576 <div id="middle1"><div id="inside" class="inside"></div></div> 594 <div id="middle1"><div id="inside" class="inside"></div></div>
577 </div> 595 </div>
578 <div id="sibling"> 596 <div id="sibling">
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 { 1123 {
1106 if (element.id == "n2" || element.id == "n2_3") 1124 if (element.id == "n2" || element.id == "n2_3")
1107 expectProcessed(test, element, element.id); 1125 expectProcessed(test, element, element.id);
1108 else 1126 else
1109 expectNotProcessed(test, element, element.id); 1127 expectNotProcessed(test, element, element.id);
1110 } 1128 }
1111 } 1129 }
1112 1130
1113 test.done(); 1131 test.done();
1114 }; 1132 };
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld