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

Side by Side Diff: pages/filters/xmlhttprequest.tmpl

Issue 29755578: Issue 2148 - Rewrite the testpages test suite (Closed)
Patch Set: Created April 18, 2018, 11:54 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 title = $xmlhttprequest - ABP Test Pages
2 template = testcase
3
4 {% set testcase_moreinfo = [
5 ("Filter Options", "https://adblockplus.org/filters#options"),
6 ] %}
7
8 <script>
9 function pagelog(message) {
10 var log = document.getElementById("testcase-fo-xmlhttprequest");
11 log.innerText = log.innerText + message + "\n";
12 console.log(message);
13 }
14
15 function aborted(evt) {
16 pagelog("XMLHTTPRequest was aborted.");
17 }
18
19 function failed(evt) {
20 pagelog("XMLHTTPRequest failed.");
21 }
22
23 function makerequest() {
24 var req = new XMLHttpRequest();
25 req.addEventListener("error", failed);
26 req.addEventListener("abort", aborted);
27 req.open("GET", "https://testpages.adblockplus.org/testcasefiles/xmlhttpreques t/text.txt", true);
28 req.onload = function(e) {
29 if (this.status == 200) {
30 pagelog(this.responseText);
31 }
32 };
33 req.send();
34 }
35
36 document.addEventListener('DOMContentLoaded', makerequest, false);
37 </script>
38
39 <section class="site-panel">
40 <h2>$xmlhttprequest</h2>
41 <p>Check that usage of the $xmlhttprequest filter option works as expected.</p >
42 </section>
43
44 <section class="site-panel">
45 <h2>Test case</h2>
46 <p>The XMLHTTPRequest should be blocked. The Image should not be blocked.</p>
47 <div class="testcase-container">
48 <div class="testcase-row">
49 <h3>XMLHTTPRequest</h3><div id="testcase-fo-xmlhttprequest"></div>
50 </div>
51 <div class="testcase-row">
52 <h3>Image</h3><img class="testcase-image" src="/testcasefiles/xmlhttpreque st/image.jpg"/>
53 </div>
54 </div>
55 <h3>Filters</h3>
56 testpages.adblockplus.org/testcasefiles/xmlhttprequest/$xmlhttprequest
57 </section>
OLDNEW

Powered by Google App Engine
This is Rietveld