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: Updated patch Created April 3, 2019, 4:29 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
533 // and issue https://issues.adblockplus.org/ticket/7428
534 async function runTestQualifier(test, selector)
535 {
536 testDocument.body.innerHTML = `
537 <style>
Manish Jethani 2019/04/03 17:09:30 Nit: We could just indent the HTML here for readab
hub 2019/04/03 17:59:59 Done.
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(
559 test,
560 "div:-abp-has(> a p > :-abp-properties(content: \"any\"))"
561 );
562 };
563
564 exports.testPropertySelectorCombinatorQualifierNested = function(test)
565 {
566 runTestQualifier(
567 test,
568 "div:-abp-has(> a p:-abp-has(> span:-abp-properties(content: \"any\")))"
569 );
570 };
571
532 async function runTestPseudoClassContains(test, selector, expectations) 572 async function runTestPseudoClassContains(test, selector, expectations)
533 { 573 {
534 testDocument.body.innerHTML = ` <style type="text/css"> 574 testDocument.body.innerHTML = ` <style type="text/css">
535 body { 575 body {
536 margin: 0; 576 margin: 0;
537 padding: 0; 577 padding: 0;
538 } 578 }
539 .transparent { 579 .transparent {
540 opacity: 0; 580 opacity: 0;
541 position: absolute; 581 position: absolute;
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 { 1186 {
1147 if (element.id == "n2" || element.id == "n2_3") 1187 if (element.id == "n2" || element.id == "n2_3")
1148 expectProcessed(test, element, element.id); 1188 expectProcessed(test, element, element.id);
1149 else 1189 else
1150 expectNotProcessed(test, element, element.id); 1190 expectNotProcessed(test, element, element.id);
1151 } 1191 }
1152 } 1192 }
1153 1193
1154 test.done(); 1194 test.done();
1155 }; 1195 };
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