Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: LayoutTests/permissionclient/audio-permissions.html

Issue 27694002: Ability to block <audio> and <video> media. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased. Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 // Blocked sounds can be reloaded, so neither onloadeddata nor onerror is called .
6 // Only check here that onloadeddata is never called when sound is blocked.
7
8 if (window.testRunner) {
9 testRunner.dumpAsText();
10 testRunner.dumpPermissionClientCallbacks();
11 }
12
13 function log(a)
14 {
15 document.getElementById("results").innerHTML += a + "<br>";
16 }
17
18 function loaded()
19 {
20 log("PASS: first sound loaded");
21 if (window.testRunner && testRunner.setMediaAllowed)
22 testRunner.setMediaAllowed(false);
23 else
24 log("This test requires testRunner.setMediaAllowed, so it be can't run i n a browser.");
25
26 // Load a sound not in cache.
27 var audio = document.createElement('audio');
28 audio.onloadeddata = function () { log("FAIL: not cached audio loaded"); }
29 audio.src = "../media/content/silence.oga?nocache";
30 document.getElementById("audio").appendChild(audio);
31
32 // Load a sound from cache.
33 var audioFromCache = document.createElement('audio');
34 audioFromCache.onloadeddata = function () { log("FAIL: audio from cache load ed"); }
35 audioFromCache.src = "../media/content/silence.oga";
36 document.getElementById("audio").appendChild(audioFromCache);
37
38 // Add an iframe with a sound.
39 var iframe = document.createElement('iframe');
40 iframe.src = "resources/audio.html";
41 document.getElementById("audio").appendChild(iframe);
42 }
43 </script>
44 </head>
45 <body>
46 <audio src="../media/content/silence.oga" onloadeddata="loaded()"></audio>
47 <div id="audio"></div>
48 <div id="results"></div>
49 </body>
50 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698