| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 void requestReload(const blink::WebURL& newUrl) override {} | 80 void requestReload(const blink::WebURL& newUrl) override {} |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 DISALLOW_COPY_AND_ASSIGN(DummyWebMediaPlayerClient); | 83 DISALLOW_COPY_AND_ASSIGN(DummyWebMediaPlayerClient); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 class WebMediaPlayerImplTest : public testing::Test { | 86 class WebMediaPlayerImplTest : public testing::Test { |
| 87 public: | 87 public: |
| 88 WebMediaPlayerImplTest() | 88 WebMediaPlayerImplTest() |
| 89 : media_thread_("MediaThreadForTest"), | 89 : media_thread_("MediaThreadForTest"), |
| 90 web_view_(blink::WebView::create(nullptr)), | 90 web_view_(blink::WebView::create(nullptr, |
| 91 blink::WebPageVisibilityStateVisible)), |
| 91 web_local_frame_( | 92 web_local_frame_( |
| 92 blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, | 93 blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, |
| 93 &web_frame_client_)), | 94 &web_frame_client_)), |
| 94 media_log_(new MediaLog()), | 95 media_log_(new MediaLog()), |
| 95 audio_parameters_(TestAudioParameters::Normal()) { | 96 audio_parameters_(TestAudioParameters::Normal()) { |
| 96 web_view_->setMainFrame(web_local_frame_); | 97 web_view_->setMainFrame(web_local_frame_); |
| 97 media_thread_.StartAndWaitForTesting(); | 98 media_thread_.StartAndWaitForTesting(); |
| 98 | 99 |
| 99 wmpi_.reset(new WebMediaPlayerImpl( | 100 wmpi_.reset(new WebMediaPlayerImpl( |
| 100 web_local_frame_, &client_, nullptr, | 101 web_local_frame_, &client_, nullptr, |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 431 EXPECT_FALSE(state.is_suspended); | 432 EXPECT_FALSE(state.is_suspended); |
| 432 | 433 |
| 433 SetPaused(false); | 434 SetPaused(false); |
| 434 state = ComputePlayStateSuspended(); | 435 state = ComputePlayStateSuspended(); |
| 435 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PLAYING, state.delegate_state); | 436 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::PLAYING, state.delegate_state); |
| 436 EXPECT_TRUE(state.is_memory_reporting_enabled); | 437 EXPECT_TRUE(state.is_memory_reporting_enabled); |
| 437 EXPECT_FALSE(state.is_suspended); | 438 EXPECT_FALSE(state.is_suspended); |
| 438 } | 439 } |
| 439 | 440 |
| 440 } // namespace media | 441 } // namespace media |
| OLD | NEW |