-
Notifications
You must be signed in to change notification settings - Fork 884
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add browser tests for cosmetic filtering
- Loading branch information
1 parent
0e7c3f5
commit 25d6c39
Showing
7 changed files
with
167 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<html> | ||
<head> | ||
<script> | ||
|
||
function addElementsDynamically() { | ||
let root = document.documentElement; | ||
for (let i = 0; i < 10; i++) { | ||
const e = document.createElement('div') | ||
e.className = 'blockme' | ||
root.appendChild(e); | ||
} | ||
|
||
for (let i = 0; i < 10; i++) { | ||
const e = document.createElement('div') | ||
e.className = 'dontblockme' | ||
root.appendChild(e); | ||
} | ||
} | ||
|
||
function checkSelector(selector, property, expected) { | ||
setTimeout(() => { | ||
let elements = [].slice.call(document.querySelectorAll(selector)); | ||
let result = elements.every(e => { | ||
let style = window.getComputedStyle(e); | ||
return style[property] === expected; | ||
}) | ||
window.domAutomationController.send(result) | ||
}, 1000) | ||
} | ||
|
||
</script> | ||
</head> | ||
<body> | ||
<div id="ad-banner"></div> | ||
<div class="ad-banner"> | ||
<div class="ad"></div> | ||
</div> | ||
<div class="ad"></div> | ||
<div class="ad"></div> | ||
</body> | ||
</html> |