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

Unified Diff: LayoutTests/media/media-controller-volume.html

Issue 217053009: Validate finiteness of HTMLMediaElement properties. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add more FIXMEs. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/media/media-controller-volume.html
diff --git a/LayoutTests/media/media-controller-volume.html b/LayoutTests/media/media-controller-volume.html
new file mode 100644
index 0000000000000000000000000000000000000000..1f61534c6bce59c4b9630e5ab7ffd90d529a5707
--- /dev/null
+++ b/LayoutTests/media/media-controller-volume.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>MediaController - volume test</title>
+ <script src=video-test.js></script>
+ <script src=media-file.js></script>
+ <script>
+ function start()
+ {
+ findMediaElement();
+ waitForEvent('canplay', canplay);
+ video.src = findMediaFile("video", "content/test");
+ };
+
+ function canplay()
+ {
+ testExpected("video.controller.volume", 1.0);
+ run("video.controller.volume = 0.5");
+ testExpected("video.controller.volume", 0.5);
+ run("video.controller.volume = Number.MIN_VALUE");
+ testExpected("video.controller.volume", Number.MIN_VALUE);
+ run("video.controller.volume = 0");
+ testExpected("video.controller.volume", 0);
+
+ testDOMException("video.controller.volume = 1.5", "DOMException.INDEX_SIZE_ERR");
+ testDOMException("video.controller.volume = -0.5", "DOMException.INDEX_SIZE_ERR");
+ testException("video.controller.volume = -Infinity", '"TypeError: Failed to set the \'volume\' property on \'MediaController\': The value provided is infinite."');
+ testException("video.controller.volume = Infinity", '"TypeError: Failed to set the \'volume\' property on \'MediaController\': The value provided is infinite."');
+ testException("video.controller.volume = NaN", '"TypeError: Failed to set the \'volume\' property on \'MediaController\': The value provided is not a number."');
+
+ endTest();
+ };
+ </script>
+</head>
+<body>
+ <body onload="start()">
+ <video id="video" mediaGroup="group" controls autoplay></video>
+ </body>
+</body>
+</html>
« no previous file with comments | « LayoutTests/media/media-controller-playbackrate-expected.txt ('k') | LayoutTests/media/media-controller-volume-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698