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

Side by Side Diff: media/blink/webmediaplayer_impl_unittest.cc

Issue 1991273003: Fire visibilityChange event on out-of-process iframes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressing comments Created 4 years, 6 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
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void cancelledRemotePlaybackRequest() override {} 78 void cancelledRemotePlaybackRequest() override {}
79 79
80 private: 80 private:
81 DISALLOW_COPY_AND_ASSIGN(DummyWebMediaPlayerClient); 81 DISALLOW_COPY_AND_ASSIGN(DummyWebMediaPlayerClient);
82 }; 82 };
83 83
84 class WebMediaPlayerImplTest : public testing::Test { 84 class WebMediaPlayerImplTest : public testing::Test {
85 public: 85 public:
86 WebMediaPlayerImplTest() 86 WebMediaPlayerImplTest()
87 : media_thread_("MediaThreadForTest"), 87 : media_thread_("MediaThreadForTest"),
88 web_view_(blink::WebView::create(nullptr)), 88 web_view_(blink::WebView::create(nullptr,
89 blink::WebPageVisibilityStateVisible)),
89 web_local_frame_( 90 web_local_frame_(
90 blink::WebLocalFrame::create(blink::WebTreeScopeType::Document, 91 blink::WebLocalFrame::create(blink::WebTreeScopeType::Document,
91 &web_frame_client_)), 92 &web_frame_client_)),
92 media_log_(new MediaLog()), 93 media_log_(new MediaLog()),
93 audio_parameters_(TestAudioParameters::Normal()) { 94 audio_parameters_(TestAudioParameters::Normal()) {
94 web_view_->setMainFrame(web_local_frame_); 95 web_view_->setMainFrame(web_local_frame_);
95 media_thread_.StartAndWaitForTesting(); 96 media_thread_.StartAndWaitForTesting();
96 97
97 wmpi_.reset(new WebMediaPlayerImpl( 98 wmpi_.reset(new WebMediaPlayerImpl(
98 web_local_frame_, &client_, nullptr, 99 web_local_frame_, &client_, nullptr,
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 EXPECT_FALSE(state.is_memory_reporting_enabled); 364 EXPECT_FALSE(state.is_memory_reporting_enabled);
364 EXPECT_FALSE(state.is_suspended); 365 EXPECT_FALSE(state.is_suspended);
365 366
366 state = ComputeIdlePlayState(); 367 state = ComputeIdlePlayState();
367 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::ENDED, state.delegate_state); 368 EXPECT_EQ(WebMediaPlayerImpl::DelegateState::ENDED, state.delegate_state);
368 EXPECT_FALSE(state.is_memory_reporting_enabled); 369 EXPECT_FALSE(state.is_memory_reporting_enabled);
369 EXPECT_TRUE(state.is_suspended); 370 EXPECT_TRUE(state.is_suspended);
370 } 371 }
371 372
372 } // namespace media 373 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698