| OLD | NEW |
| 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 "core/html/shadow/MediaControls.h" | 5 #include "core/html/shadow/MediaControls.h" |
| 6 | 6 |
| 7 #include "core/HTMLNames.h" | 7 #include "core/HTMLNames.h" |
| 8 #include "core/css/StylePropertySet.h" | 8 #include "core/css/StylePropertySet.h" |
| 9 #include "core/dom/Document.h" | 9 #include "core/dom/Document.h" |
| 10 #include "core/dom/ElementTraversal.h" | 10 #include "core/dom/ElementTraversal.h" |
| 11 #include "core/dom/StyleEngine.h" | 11 #include "core/dom/StyleEngine.h" |
| 12 #include "core/frame/Settings.h" | 12 #include "core/frame/Settings.h" |
| 13 #include "core/html/HTMLVideoElement.h" | 13 #include "core/html/HTMLVideoElement.h" |
| 14 #include "core/loader/EmptyClients.h" | 14 #include "core/loader/EmptyClients.h" |
| 15 #include "core/testing/DummyPageHolder.h" | 15 #include "core/testing/DummyPageHolder.h" |
| 16 #include "platform/heap/Handle.h" | 16 #include "platform/heap/Handle.h" |
| 17 #include "platform/testing/UnitTestHelpers.h" | 17 #include "platform/testing/UnitTestHelpers.h" |
| 18 #include "public/platform/WebMediaPlayer.h" | 18 #include "public/platform/WebMediaPlayer.h" |
| 19 #include "public/platform/WebSize.h" | 19 #include "public/platform/WebSize.h" |
| 20 #include "public/platform/modules/remoteplayback/WebRemotePlaybackClient.h" |
| 20 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
| 21 #include <memory> | 22 #include <memory> |
| 22 | 23 |
| 23 namespace blink { | 24 namespace blink { |
| 24 | 25 |
| 25 namespace { | 26 namespace { |
| 26 | 27 |
| 27 class MockVideoWebMediaPlayer : public WebMediaPlayer { | 28 class MockVideoWebMediaPlayer : public WebMediaPlayer { |
| 28 public: | 29 public: |
| 29 void load(LoadType, const WebMediaPlayerSource&, CORSMode) override{}; | 30 void load(LoadType, const WebMediaPlayerSource&, CORSMode) override{}; |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 class StubFrameLoaderClient : public EmptyFrameLoaderClient { | 65 class StubFrameLoaderClient : public EmptyFrameLoaderClient { |
| 65 public: | 66 public: |
| 66 static StubFrameLoaderClient* create() { return new StubFrameLoaderClient; } | 67 static StubFrameLoaderClient* create() { return new StubFrameLoaderClient; } |
| 67 | 68 |
| 68 std::unique_ptr<WebMediaPlayer> createWebMediaPlayer( | 69 std::unique_ptr<WebMediaPlayer> createWebMediaPlayer( |
| 69 HTMLMediaElement&, | 70 HTMLMediaElement&, |
| 70 const WebMediaPlayerSource&, | 71 const WebMediaPlayerSource&, |
| 71 WebMediaPlayerClient*) override { | 72 WebMediaPlayerClient*) override { |
| 72 return wrapUnique(new MockVideoWebMediaPlayer); | 73 return wrapUnique(new MockVideoWebMediaPlayer); |
| 73 } | 74 } |
| 75 |
| 76 WebRemotePlaybackClient* createWebRemotePlaybackClient( |
| 77 ScriptState*, |
| 78 HTMLMediaElement&) override { |
| 79 return nullptr; |
| 80 } |
| 74 }; | 81 }; |
| 75 | 82 |
| 76 Element* getElementByShadowPseudoId(Node& rootNode, | 83 Element* getElementByShadowPseudoId(Node& rootNode, |
| 77 const char* shadowPseudoId) { | 84 const char* shadowPseudoId) { |
| 78 for (Element& element : ElementTraversal::descendantsOf(rootNode)) { | 85 for (Element& element : ElementTraversal::descendantsOf(rootNode)) { |
| 79 if (element.shadowPseudoId() == shadowPseudoId) | 86 if (element.shadowPseudoId() == shadowPseudoId) |
| 80 return &element; | 87 return &element; |
| 81 } | 88 } |
| 82 return nullptr; | 89 return nullptr; |
| 83 } | 90 } |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 mediaControls().show(); | 285 mediaControls().show(); |
| 279 mediaControls().toggleOverflowMenu(); | 286 mediaControls().toggleOverflowMenu(); |
| 280 EXPECT_TRUE(isElementVisible(*overflowList)); | 287 EXPECT_TRUE(isElementVisible(*overflowList)); |
| 281 | 288 |
| 282 simulateHideMediaControlsTimerFired(); | 289 simulateHideMediaControlsTimerFired(); |
| 283 EXPECT_TRUE(isElementVisible(*overflowList)); | 290 EXPECT_TRUE(isElementVisible(*overflowList)); |
| 284 EXPECT_TRUE(isElementVisible(*panel)); | 291 EXPECT_TRUE(isElementVisible(*panel)); |
| 285 } | 292 } |
| 286 | 293 |
| 287 } // namespace blink | 294 } // namespace blink |
| OLD | NEW |