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: Move test.done() out of runTest Created April 2, 2019, 2:28 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 11:15:58 Shouldn't this be 7400?
hub 2019/04/03 16:30:07 The test is actually all based on issue #7359. It
Manish Jethani 2019/04/03 17:09:30 Sorry, isn't the second test here affected by 7400
Manish Jethani 2019/04/03 17:26:53 OK, I looked at 7359 again. The only thing it adds
Manish Jethani 2019/04/03 17:28:49 Misspoke, of course the `>span` case is valid only
533 // and issue https://issues.adblockplus.org/ticket/7428
534 async function runTestCombinatorQualifier(test, selector)
Manish Jethani 2019/04/03 11:15:58 I think what you mean is `runTestCompoundQualifier
hub 2019/04/03 16:30:07 Done.
535 {
536 testDocument.body.innerHTML = `
537 <style>
538 span::before {
539 content: "any";
540 }
541 </style>
542 <div id="toHide">
543 <a>
Manish Jethani 2019/04/03 11:15:58 Nit: It is more natural if `<a>` occurs with the `
hub 2019/04/03 16:30:07 if everything was done in a "natural way", lot of
Manish Jethani 2019/04/03 16:40:02 Fair enough :)
544 <p>
545 <span></span>
546 </p>
547 </a>
548 </div>
549 `;
550 if (await applyElemHideEmulation(test, [selector]))
551 {
Manish Jethani 2019/04/03 11:15:58 Nit: No need for the braces here.
hub 2019/04/03 16:30:07 Done.
552 expectHidden(test, testDocument.getElementById("toHide"));
553 }
554 }
555
556 exports.testPropertySelectorCombinatorQualifier = async function(test)
557 {
558 await runTestCombinatorQualifier(
559 test,
560 "div:-abp-has(> a p > :-abp-properties(content: \"any\"))"
561 );
562
563 test.done();
Manish Jethani 2019/04/03 11:15:58 My reason for asking to move `test.done()` here wa
hub 2019/04/03 16:30:07 Having actually separate test cases is important b
Manish Jethani 2019/04/03 16:40:02 Well in that case I think it's OK to just move `te
hub 2019/04/03 16:41:57 already done :-)
564 };
565
566 exports.testPropertySelectorCombinatorQualifier2 = async function(test)
567 {
568 await runTestCombinatorQualifier(
569 test,
570 "div:-abp-has(> a p:-abp-has(> span:-abp-properties(content: \"any\")))"
571 );
572
573 test.done();
574 };
575
532 async function runTestPseudoClassContains(test, selector, expectations) 576 async function runTestPseudoClassContains(test, selector, expectations)
533 { 577 {
534 testDocument.body.innerHTML = ` <style type="text/css"> 578 testDocument.body.innerHTML = ` <style type="text/css">
535 body { 579 body {
536 margin: 0; 580 margin: 0;
537 padding: 0; 581 padding: 0;
538 } 582 }
539 .transparent { 583 .transparent {
540 opacity: 0; 584 opacity: 0;
541 position: absolute; 585 position: absolute;
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 { 1190 {
1147 if (element.id == "n2" || element.id == "n2_3") 1191 if (element.id == "n2" || element.id == "n2_3")
1148 expectProcessed(test, element, element.id); 1192 expectProcessed(test, element, element.id);
1149 else 1193 else
1150 expectNotProcessed(test, element, element.id); 1194 expectNotProcessed(test, element, element.id);
1151 } 1195 }
1152 } 1196 }
1153 1197
1154 test.done(); 1198 test.done();
1155 }; 1199 };
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