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

Side by Side Diff: third_party/WebKit/LayoutTests/media/video-dom-preload.html

Issue 2466273006: Allow metadata preload on cellular connections and disallow autoplay muted for low end devices. (Closed)
Patch Set: add not allowed value Created 4 years, 1 month 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 <title>Test media "autoplay" attribute set via DOM.</title>
3 <script src="../resources/testharness.js"></script>
4 <script src="../resources/testharnessreport.js"></script>
5 <video></video>
6 <script>
7 test(function() {
8 var video = document.querySelector("video");
9
10 // Test default attribute value.
11 assert_equals(video.preload, "auto");
12 assert_equals(video.getAttribute("preload"), null);
13
14 // Remove attribute, should revert to default.
15 video.removeAttribute("preload");
16 assert_equals(video.preload, "auto");
17
18 checkPreloadValue("none", "none");
19 checkPreloadValue("auto", "auto");
20
21 // set to bogus value, should revert to default value.
22 video.removeAttribute("preload");
23 // Set via IDL attribute
24 video.preload = "bogus";
25 assert_equals(video.getAttribute("preload"), "bogus");
26 assert_equals(video.preload, "auto");
27 // - and via content attribute.
28 video.setAttribute("preload", "bogus");
29 assert_equals(video.preload, "auto");
30 assert_equals(video.getAttribute("preload"), "bogus");
31
32 checkPreloadValue("metadata", "metadata");
33
34 function checkPreloadValue(value, expected) {
35 // Set via IDL attribute
36 video.removeAttribute("preload");
37 video.preload = value;
38 assert_equals(video.getAttribute("preload"), expected);
39 assert_equals(video.preload, expected);
40 // - and via content attribute.
41 video.removeAttribute("preload");
42 video.setAttribute("preload", value);
43 assert_equals(video.preload, expected);
44 assert_equals(video.getAttribute("preload"), expected);
45 }
46 });
47 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698