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

Unified Diff: third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html

Issue 2470503003: Media controls max width is the width of the viewport. (Closed)
Patch Set: dcheck 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html
diff --git a/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html b/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html
new file mode 100644
index 0000000000000000000000000000000000000000..89b308956eb9bf25d05dd020e0e7ac61b8551c33
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/media/media-controls-overflow-visible.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html>
+<script>
+ internals.settings.setViewportEnabled(true);
+ internals.settings.setViewportMetaEnabled(true);
+</script>
+<head>
+<title>Test that no overflow with a small viewport clips the controls</title>
+<meta name='viewport' content='width=300'>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="media-file.js"></script>
+<script src="media-controls.js"></script>
+</head>
+<body>
+ <video controls width=400></video>
+ <video controls width=800></video>
+ <video controls width=1200></video>
+ <video controls width=600 style='padding: 100px'></video>
+</body>
+<script>
+test(_ => {
+ const expectedWidth = [
+ "400px",
+ "800px",
+ "1200px",
+ "600px",
+ ];
+
+ var videos = document.querySelectorAll('video');
+ for (var i=0; i < videos.length; ++i) {
+ videos[i].src = findMediaFile('video', 'content/test');
+ }
+
+ var forceLayout = document.body.offsetHeight;
+
+ for (var i=0; i < videos.length; ++i) {
+ var controls = mediaControlsButton(videos[i], 'panel');
+ assert_equals(getComputedStyle(controls).width, expectedWidth[i]);
+ }
+});
+</script>
+</html>

Powered by Google App Engine
This is Rietveld 408576698