| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 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) { | |
| 14 var log = document.getElementById("testcase-fo-webrtc"); | |
| 15 log.innerText = log.innerText + message + "\n"; | |
| 16 console.log(message); | |
| 17 } | |
| 18 | |
| 19 function handleReceiveMessage(event) { | 13 function handleReceiveMessage(event) { |
| 20 pagelog(event.data); | 14 pagelog(event.data); |
| 21 } | 15 } |
| 22 | 16 |
| 23 function handleLocalAddCandidateSuccess() { | 17 function handleLocalAddCandidateSuccess() { |
| 24 pagelog("handleLocalAddCandidateSuccess()") | 18 pagelog("handleLocalAddCandidateSuccess()") |
| 25 } | 19 } |
| 26 | 20 |
|
kzar
2018/04/19 13:08:22
Nit: Please could you remove the trailing whitespa
| |
| 27 function handleRemoteAddCandidateSuccess() { | 21 function handleRemoteAddCandidateSuccess() { |
| 28 pagelog("handleRemoteAddCandidateSuccess()") | 22 pagelog("handleRemoteAddCandidateSuccess()") |
| 29 } | 23 } |
| 30 | 24 |
| 31 function handleReceiveChannelStatusChange(event) { | 25 function handleReceiveChannelStatusChange(event) { |
| 32 if (receiveChannel) { | 26 if (receiveChannel) { |
| 33 pagelog("Receive channel's status has changed to " + receiveChannel.readySta te); | 27 pagelog("Receive channel's status has changed to " + receiveChannel.readySta te); |
| 34 } | 28 } |
| 35 } | 29 } |
| 36 | 30 |
| 37 function handleSendChannelStatusChange(event) { | 31 function handleSendChannelStatusChange(event) { |
| 38 if (sendChannel) { | 32 if (sendChannel) { |
| 39 var state = sendChannel.readyState; | 33 var state = sendChannel.readyState; |
| 40 | 34 |
|
kzar
2018/04/19 13:08:22
Nit: Please could you remove the trailing whitespa
| |
| 41 if (state === "open") { | 35 if (state === "open") { |
| 42 pagelog("handleSendChannelStatusChange() open") | 36 pagelog("handleSendChannelStatusChange() open") |
| 43 sendChannel.send("Test Message"); | 37 sendChannel.send("Test Message"); |
| 44 } else { | 38 } else { |
| 45 pagelog("handleSendChannelStatusChange() not open") | 39 pagelog("handleSendChannelStatusChange() not open") |
| 46 } | 40 } |
| 47 } | 41 } |
| 48 } | 42 } |
| 49 | 43 |
| 50 function receiveChannelCallback(event) { | 44 function receiveChannelCallback(event) { |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 80 .then(() => localConnection.setRemoteDescription(remoteConnection.localDescr iption)) | 74 .then(() => localConnection.setRemoteDescription(remoteConnection.localDescr iption)) |
| 81 .catch(handleCreateDescriptionError); | 75 .catch(handleCreateDescriptionError); |
| 82 } | 76 } |
| 83 | 77 |
| 84 document.addEventListener('DOMContentLoaded', do_connect, false); | 78 document.addEventListener('DOMContentLoaded', do_connect, false); |
| 85 </script> | 79 </script> |
| 86 | 80 |
| 87 <section class="site-panel"> | 81 <section class="site-panel"> |
| 88 <h2>$webrtc</h2> | 82 <h2>$webrtc</h2> |
| 89 <p>Check that usage of the $webrtc filter option works as expected.</p> | 83 <p>Check that usage of the $webrtc filter option works as expected.</p> |
| 84 <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> | |
| 85 <p>Note: This test does not work correctly yet.</p> | |
| 90 </section> | 86 </section> |
| 91 | 87 |
| 92 <section class="site-panel"> | 88 <section class="site-panel"> |
| 93 <h2>Test case</h2> | 89 <h2>Test case</h2> |
| 94 <div class="testcase-container"> | 90 <div class="testcase-container"> |
| 95 <div class="testcase-row"> | 91 <div class="testcase-row"> |
| 96 <h3>WebRTC Request</h3><div id="testcase-fo-webrtc"></div> | 92 <h3>WebRTC Request</h3><div id="testcase-output"></div> |
| 97 </div> | 93 </div> |
| 98 </div> | 94 </div> |
| 99 <h3>Filters</h3> | 95 <h3>Filters</h3> |
| 100 $webrtc,domain=testpages.adblockplus.org | 96 <pre>$webrtc,domain=testpages.adblockplus.org</pre> |
| 101 </section> | 97 </section> |
| LEFT | RIGHT |