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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/media/controls-list-add-hide.html

Issue 2657723002: [Blink, Media] Added controlsList to HTMLMediaElement (Closed)
Patch Set: Added layout tests Created 3 years, 10 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: third_party/WebKit/LayoutTests/http/tests/media/controls-list-add-hide.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/media/controls-list-add-hide.html b/third_party/WebKit/LayoutTests/http/tests/media/controls-list-add-hide.html
new file mode 100644
index 0000000000000000000000000000000000000000..d9f11b39d9ac76c9d36ba4abca5e0b1685f6cac7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/media/controls-list-add-hide.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<title>Test adding keywords to controlsList hides buttons</title>
mlamouri (slow - plz ping) 2017/03/03 10:38:41 Can you put the tests in the controls/ directory?
whywhat 2017/03/03 16:04:55 Done.
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../../media-resources/media-file.js"></script>
+<script src="../../media-resources/media-controls.js"></script>
+<video controls id="enabled-controls" width="500px"></video>
+<script>
+async_test(t => {
+ var v = document.getElementById('enabled-controls');
+
+ v.addEventListener('canplaythrough', t.step_func(e => {
+ assert_not_equals(getComputedStyle(fullscreenButton(v)).display, 'none');
+ assert_not_equals(getComputedStyle(downloadButton(v)).display, 'none');
+
+ v.controlsList.add('nodownload');
mlamouri (slow - plz ping) 2017/03/03 10:38:41 By which mechanism does this create a re-layout of
whywhat 2017/03/03 16:04:55 Each time it changes, controlsList object tells HT
+
+ testRunner.layoutAndPaintAsyncThen(t.step_func(() => {
+ assert_not_equals(getComputedStyle(fullscreenButton(v)).display, 'none');
+ assert_equals(getComputedStyle(downloadButton(v)).display, 'none');
+ v.controlsList.add('nofullscreen');
+
+ testRunner.layoutAndPaintAsyncThen(t.step_func_done(() => {
+ assert_equals(getComputedStyle(fullscreenButton(v)).display, 'none');
+ assert_equals(getComputedStyle(downloadButton(v)).display, 'none');
+ }));
+ }));
+ }));
+
+ v.src = findMediaFile('video', 'resources/test');
+}, 'Test disabling controls on the video element with all controls.');
+</script>

Powered by Google App Engine
This is Rietveld 408576698