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

Unified Diff: pages/filters/ping.tmpl

Issue 29755578: Issue 2148 - Rewrite the testpages test suite (Closed)
Patch Set: Fixed README title Created June 7, 2018, 1:58 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pages/filters/object-subrequest.tmpl ('k') | pages/filters/popup.tmpl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pages/filters/ping.tmpl
===================================================================
--- a/pages/filters/ping.tmpl
+++ b/pages/filters/ping.tmpl
@@ -1,4 +1,4 @@
-title = $ping - ABP Test Pages
+title = $ping
template = testcase
{% set testcase_moreinfo = [
@@ -7,27 +7,26 @@
<script>
-function pagelog(message) {
- var log = document.getElementById("testcase-fo-ping");
- log.innerText = log.innerText + message + "\n";
- console.log(message);
-}
-
function do_ping() {
var button = document.getElementById("ping-button");
button.parentNode.removeChild(button);
- pagelog( "Calling navigator.sendBeacon()" );
+ pagelog("Calling navigator.sendBeacon()");
var res = navigator.sendBeacon("/en/filters/ping", "Testdata" );
pagelog("navigator.sendBeacon() called.");
- (res ? pagelog("navigator.sendBeacon() returned true.") : pagelog("Beacon could not be queued."));
+ if (res)
+ pagelog("navigator.sendBeacon() returned true.");
+ else
+ pagelog("Beacon could not be queued.");
+
}
</script>
<section class="site-panel">
<h2>$ping</h2>
<p>Check that usage of the $ping filter option is working as expected.</p>
+ <p>With the filter displayed below each test case added to ABP (or with the testcase subscription installed and active), the pings triggered in the test case panels below should be blocked.</p>
<p>Note: Browsers will always return true if the ping is successfully queued, not if sent. Check with the Adblock Plus DevTools panel to check if it was actually blocked.</p>
</section>
@@ -39,7 +38,7 @@
</div>
</div>
<h3>Filters</h3>
- testpages.adblockplus.org/*^$ping
+ <pre>testpages.adblockplus.org/*^$ping</pre>
</section>
<section class="site-panel">
@@ -48,9 +47,10 @@
<div class="testcase-row"><h3>Ping</h3>
<div id="testcase-fo-ping">
<button id="ping-button" onclick="do_ping()">Send Ping</button>
+ <div id="testcase-output"></div>
</div>
</div>
</div>
<h3>Filters</h3>
- testpages.adblockplus.org/*^$ping
+ <pre>testpages.adblockplus.org/*^$ping</pre>
</section>
« no previous file with comments | « pages/filters/object-subrequest.tmpl ('k') | pages/filters/popup.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld