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

Side by Side Diff: content/browser/media/session/media_session_impl_visibility_browsertest.cc

Issue 2681863005: [Video] MediaSession API event handlers can resume background video. (Closed)
Patch Set: Updated the comment in ComputePlayState Created 3 years, 9 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 | « no previous file | content/renderer/media/renderer_webmediaplayer_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <tuple> 5 #include <tuple>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 void CheckSessionStateAfterHide() { 158 void CheckSessionStateAfterHide() {
159 MediaSessionImpl::State state_before_hide = 159 MediaSessionImpl::State state_before_hide =
160 ToMediaSessionState(GetVisibilityTestData().session_state_before_hide); 160 ToMediaSessionState(GetVisibilityTestData().session_state_before_hide);
161 MediaSessionImpl::State state_after_hide = 161 MediaSessionImpl::State state_after_hide =
162 ToMediaSessionState(GetVisibilityTestData().session_state_after_hide); 162 ToMediaSessionState(GetVisibilityTestData().session_state_after_hide);
163 163
164 if (state_before_hide == state_after_hide) { 164 if (state_before_hide == state_after_hide) {
165 LOG(INFO) << "Waiting for 1 second and check session state is unchanged"; 165 LOG(INFO) << "Waiting for 1 second and check session state is unchanged";
166 Wait(base::TimeDelta::FromSeconds(1)); 166 Wait(base::TimeDelta::FromSeconds(1));
167 ASSERT_EQ(media_session_->audio_focus_state_, state_after_hide); 167 ASSERT_EQ(state_after_hide, media_session_->audio_focus_state_);
168 } else { 168 } else {
169 LOG(INFO) << "Waiting for Session to change"; 169 LOG(INFO) << "Waiting for Session to change";
170 WaitForMediaSessionState(state_after_hide); 170 WaitForMediaSessionState(state_after_hide);
171 } 171 }
172 172
173 LOG(INFO) << "Test succeeded"; 173 LOG(INFO) << "Test succeeded";
174 } 174 }
175 175
176 private: 176 private:
177 void LoadTestPage() { 177 void LoadTestPage() {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 MaybePausePlayer(); 271 MaybePausePlayer();
272 HideTab(); 272 HideTab();
273 CheckSessionStateAfterHide(); 273 CheckSessionStateAfterHide();
274 } 274 }
275 275
276 INSTANTIATE_TEST_CASE_P(MediaSessionImplVisibilityBrowserTestInstances, 276 INSTANTIATE_TEST_CASE_P(MediaSessionImplVisibilityBrowserTestInstances,
277 MediaSessionImplVisibilityBrowserTest, 277 MediaSessionImplVisibilityBrowserTest,
278 ::testing::ValuesIn(kTestParams)); 278 ::testing::ValuesIn(kTestParams));
279 279
280 } // namespace content 280 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/renderer_webmediaplayer_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698