-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test page for CPM filterlist (#248)
* Add a test page for CPM filterlist * Add a dedicated index page for CPM
- Loading branch information
Showing
4 changed files
with
60 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Autoconsent Feature Tests</title> | ||
</head> | ||
<body> | ||
<p><a href="../">[Home]</a> ↣ <strong>[Autoconsent Feature Tests]</strong></p> | ||
|
||
<h1>Autoconsent Feature Tests</h1> | ||
|
||
<ul> | ||
<li><a href='./index.html'>Normal cookie popup</a></li> | ||
<li><a href='./banner.html'>Cookie notice (cosmetic hiding rule)</a></li> | ||
<li><a href='./filterlist.html'>Test for cosmetic filterlist</a></li> | ||
</ul> | ||
</body> | ||
</html> |
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,20 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
<title>Cookie consent notice banner (Filterlist)</title> | ||
|
||
<script src='./filterlist.js' defer></script> | ||
</head> | ||
<body> | ||
<p><a href="/index.html">[Home]</a></p> | ||
|
||
<p>Tests for filterlist-based hiding of cookie banners.</P> | ||
|
||
<div id="privacy-test-page-cmp-test-banner-filterlist"> | ||
This is a fake cookie banner that should be hidden by filterlist. | ||
</div> | ||
|
||
</body> | ||
</html> |
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,20 @@ | ||
const acceptButton = document.createElement('button'); | ||
acceptButton.innerText = 'Accept all'; | ||
acceptButton.id = 'accept-all'; | ||
const banner = document.quesrySelector('#privacy-test-page-cmp-test-banner-filterlist'); | ||
banner.appendChild(acceptButton); | ||
acceptButton.addEventListener('click', (ev) => { | ||
ev.target.innerText = 'Accept was clicked!'; | ||
window.results.results.push('accept_button_clicked'); | ||
}); | ||
|
||
setTimeout(() => { | ||
if (window.getComputedStyle(banner).opacity === '0') { | ||
window.results.results.push('banner_hidden'); | ||
} | ||
}, 500); | ||
|
||
window.results = { | ||
page: 'autoconsent-filterlist', | ||
results: [] | ||
}; |
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