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

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

Issue 29755578: Issue 2148 - Rewrite the testpages test suite (Closed)
Patch Set: Addressed Dave's feedback Created June 4, 2018, 1:21 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
OLDNEW
1 title = $webrtc - ABP Test Pages 1 title = $webrtc
2 template = testcase 2 template = testcase
3 3
4 {% set testcase_moreinfo = [ 4 {% set testcase_moreinfo = [
5 ("Filter Options", "https://adblockplus.org/filters#options"), 5 ("Filter Options", "https://adblockplus.org/filters#options"),
6 ] %} 6 ] %}
7 7
8 8
9 <script> 9 <script>
10 10
11 // Borrowed from https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Sim ple_RTCDataChannel_sample 11 // Borrowed from https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API/Sim ple_RTCDataChannel_sample
12 12
13 function pagelog(message) { 13 function pagelog(message) {
14 var log = document.getElementById("testcase-fo-webrtc"); 14 var log = document.getElementById("testcase-fo-webrtc");
15 log.innerText = log.innerText + message + "\n"; 15 log.innerText = log.innerText + message + "\n";
16 console.log(message); 16 console.log(message);
17 } 17 }
18 18
19 function handleReceiveMessage(event) { 19 function handleReceiveMessage(event) {
20 pagelog(event.data); 20 pagelog(event.data);
21 } 21 }
22 22
23 function handleLocalAddCandidateSuccess() { 23 function handleLocalAddCandidateSuccess() {
24 pagelog("handleLocalAddCandidateSuccess()") 24 pagelog("handleLocalAddCandidateSuccess()")
25 } 25 }
26 26
27 function handleRemoteAddCandidateSuccess() { 27 function handleRemoteAddCandidateSuccess() {
28 pagelog("handleRemoteAddCandidateSuccess()") 28 pagelog("handleRemoteAddCandidateSuccess()")
29 } 29 }
30 30
31 function handleReceiveChannelStatusChange(event) { 31 function handleReceiveChannelStatusChange(event) {
32 if (receiveChannel) { 32 if (receiveChannel) {
33 pagelog("Receive channel's status has changed to " + receiveChannel.readySta te); 33 pagelog("Receive channel's status has changed to " + receiveChannel.readySta te);
34 } 34 }
35 } 35 }
36 36
37 function handleSendChannelStatusChange(event) { 37 function handleSendChannelStatusChange(event) {
38 if (sendChannel) { 38 if (sendChannel) {
39 var state = sendChannel.readyState; 39 var state = sendChannel.readyState;
40 40
41 if (state === "open") { 41 if (state === "open") {
42 pagelog("handleSendChannelStatusChange() open") 42 pagelog("handleSendChannelStatusChange() open")
43 sendChannel.send("Test Message"); 43 sendChannel.send("Test Message");
44 } else { 44 } else {
45 pagelog("handleSendChannelStatusChange() not open") 45 pagelog("handleSendChannelStatusChange() not open")
46 } 46 }
47 } 47 }
48 } 48 }
49 49
50 function receiveChannelCallback(event) { 50 function receiveChannelCallback(event) {
(...skipping 29 matching lines...) Expand all
80 .then(() => localConnection.setRemoteDescription(remoteConnection.localDescr iption)) 80 .then(() => localConnection.setRemoteDescription(remoteConnection.localDescr iption))
81 .catch(handleCreateDescriptionError); 81 .catch(handleCreateDescriptionError);
82 } 82 }
83 83
84 document.addEventListener('DOMContentLoaded', do_connect, false); 84 document.addEventListener('DOMContentLoaded', do_connect, false);
85 </script> 85 </script>
86 86
87 <section class="site-panel"> 87 <section class="site-panel">
88 <h2>$webrtc</h2> 88 <h2>$webrtc</h2>
89 <p>Check that usage of the $webrtc filter option works as expected.</p> 89 <p>Check that usage of the $webrtc filter option works as expected.</p>
90 <p>With the filter displayed below each test case added to ABP (or with the te stcase subscription installed and active), the WebRTC connection should be block ed.</p>
91 <p>Note: This test does not work correctly yet.</p>
90 </section> 92 </section>
91 93
92 <section class="site-panel"> 94 <section class="site-panel">
93 <h2>Test case</h2> 95 <h2>Test case</h2>
94 <div class="testcase-container"> 96 <div class="testcase-container">
95 <div class="testcase-row"> 97 <div class="testcase-row">
96 <h3>WebRTC Request</h3><div id="testcase-fo-webrtc"></div> 98 <h3>WebRTC Request</h3><div id="testcase-fo-webrtc"></div>
97 </div> 99 </div>
98 </div> 100 </div>
99 <h3>Filters</h3> 101 <h3>Filters</h3>
100 $webrtc,domain=testpages.adblockplus.org 102 <pre>$webrtc,domain=testpages.adblockplus.org</pre>
101 </section> 103 </section>
OLDNEW

Powered by Google App Engine
This is Rietveld