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

Side by Side Diff: third_party/WebKit/Source/modules/media_controls/MediaControlsImplTest.cpp

Issue 2873493004: [Media Controls] Prevent flicker when enter/exit fullscreen (Closed)
Patch Set: Add virtual/new-remote-playback-pipeline variants to SlowTests Created 3 years, 7 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
« no previous file with comments | « third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/media_controls/MediaControlsImpl.h" 5 #include "modules/media_controls/MediaControlsImpl.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <memory> 8 #include <memory>
9 #include "core/HTMLNames.h" 9 #include "core/HTMLNames.h"
10 #include "core/css/StylePropertySet.h" 10 #include "core/css/StylePropertySet.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 MediaControls().MediaElement().SetBooleanAttribute(HTMLNames::controlsAttr, 252 MediaControls().MediaElement().SetBooleanAttribute(HTMLNames::controlsAttr,
253 true); 253 true);
254 254
255 Element* panel = GetElementByShadowPseudoId(MediaControls(), 255 Element* panel = GetElementByShadowPseudoId(MediaControls(),
256 "-webkit-media-controls-panel"); 256 "-webkit-media-controls-panel");
257 ASSERT_NE(nullptr, panel); 257 ASSERT_NE(nullptr, panel);
258 258
259 ASSERT_TRUE(IsElementVisible(*panel)); 259 ASSERT_TRUE(IsElementVisible(*panel));
260 MediaControls().Hide(); 260 MediaControls().Hide();
261 ASSERT_FALSE(IsElementVisible(*panel)); 261 ASSERT_FALSE(IsElementVisible(*panel));
262 MediaControls().Show(); 262 MediaControls().MaybeShow();
263 ASSERT_TRUE(IsElementVisible(*panel)); 263 ASSERT_TRUE(IsElementVisible(*panel));
264 } 264 }
265 265
266 TEST_F(MediaControlsImplTest, Reset) { 266 TEST_F(MediaControlsImplTest, Reset) {
267 MediaControls().MediaElement().SetBooleanAttribute(HTMLNames::controlsAttr, 267 MediaControls().MediaElement().SetBooleanAttribute(HTMLNames::controlsAttr,
268 true); 268 true);
269 269
270 Element* panel = GetElementByShadowPseudoId(MediaControls(), 270 Element* panel = GetElementByShadowPseudoId(MediaControls(),
271 "-webkit-media-controls-panel"); 271 "-webkit-media-controls-panel");
272 ASSERT_NE(nullptr, panel); 272 ASSERT_NE(nullptr, panel);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 ASSERT_NE(nullptr, overflow_list); 391 ASSERT_NE(nullptr, overflow_list);
392 392
393 Element* panel = GetElementByShadowPseudoId(MediaControls(), 393 Element* panel = GetElementByShadowPseudoId(MediaControls(),
394 "-webkit-media-controls-panel"); 394 "-webkit-media-controls-panel");
395 ASSERT_NE(nullptr, panel); 395 ASSERT_NE(nullptr, panel);
396 396
397 MediaControls().MediaElement().SetSrc("http://example.com"); 397 MediaControls().MediaElement().SetSrc("http://example.com");
398 MediaControls().MediaElement().Play(); 398 MediaControls().MediaElement().Play();
399 testing::RunPendingTasks(); 399 testing::RunPendingTasks();
400 400
401 MediaControls().Show(); 401 MediaControls().MaybeShow();
402 MediaControls().ToggleOverflowMenu(); 402 MediaControls().ToggleOverflowMenu();
403 EXPECT_TRUE(IsElementVisible(*overflow_list)); 403 EXPECT_TRUE(IsElementVisible(*overflow_list));
404 404
405 SimulateHideMediaControlsTimerFired(); 405 SimulateHideMediaControlsTimerFired();
406 EXPECT_TRUE(IsElementVisible(*overflow_list)); 406 EXPECT_TRUE(IsElementVisible(*overflow_list));
407 EXPECT_TRUE(IsElementVisible(*panel)); 407 EXPECT_TRUE(IsElementVisible(*panel));
408 } 408 }
409 409
410 TEST_F(MediaControlsImplTest, DownloadButtonDisplayed) { 410 TEST_F(MediaControlsImplTest, DownloadButtonDisplayed) {
411 EnsureSizing(); 411 EnsureSizing();
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
884 { 884 {
885 Persistent<HTMLMediaElement> video_holder = element; 885 Persistent<HTMLMediaElement> video_holder = element;
886 page_holder->GetDocument().body()->RemoveChild(element); 886 page_holder->GetDocument().body()->RemoveChild(element);
887 page_holder->GetDocument().body()->AppendChild(video_holder.Get()); 887 page_holder->GetDocument().body()->AppendChild(video_holder.Get());
888 EXPECT_TRUE(remote_playback->HasEventListeners()); 888 EXPECT_TRUE(remote_playback->HasEventListeners());
889 EXPECT_TRUE(HasAvailabilityCallbacks(remote_playback)); 889 EXPECT_TRUE(HasAvailabilityCallbacks(remote_playback));
890 } 890 }
891 } 891 }
892 892
893 } // namespace blink 893 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/media_controls/MediaControlsImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698