| 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 <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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 }; | 244 }; |
| 245 | 245 |
| 246 namespace { | 246 namespace { |
| 247 | 247 |
| 248 VisibilityTestData kTestParams[] = { | 248 VisibilityTestData kTestParams[] = { |
| 249 {MediaSuspend::ENABLED, BackgroundResuming::DISABLED, | 249 {MediaSuspend::ENABLED, BackgroundResuming::DISABLED, |
| 250 SessionState::SUSPENDED, SessionState::INACTIVE}, | 250 SessionState::SUSPENDED, SessionState::INACTIVE}, |
| 251 {MediaSuspend::ENABLED, BackgroundResuming::DISABLED, SessionState::ACTIVE, | 251 {MediaSuspend::ENABLED, BackgroundResuming::DISABLED, SessionState::ACTIVE, |
| 252 SessionState::INACTIVE}, | 252 SessionState::INACTIVE}, |
| 253 {MediaSuspend::ENABLED, BackgroundResuming::ENABLED, SessionState::ACTIVE, | 253 {MediaSuspend::ENABLED, BackgroundResuming::ENABLED, SessionState::ACTIVE, |
| 254 // TODO(avayvod): Revert after merge to 58. See https://crbug.com/699106. |
| 255 #if defined(OS_ANDROID) |
| 254 SessionState::SUSPENDED}, | 256 SessionState::SUSPENDED}, |
| 257 #else |
| 258 SessionState::ACTIVE}, |
| 259 #endif |
| 255 {MediaSuspend::ENABLED, BackgroundResuming::ENABLED, | 260 {MediaSuspend::ENABLED, BackgroundResuming::ENABLED, |
| 256 SessionState::SUSPENDED, SessionState::SUSPENDED}, | 261 SessionState::SUSPENDED, SessionState::SUSPENDED}, |
| 257 {MediaSuspend::DISABLED, BackgroundResuming::DISABLED, | 262 {MediaSuspend::DISABLED, BackgroundResuming::DISABLED, |
| 258 SessionState::SUSPENDED, SessionState::SUSPENDED}, | 263 SessionState::SUSPENDED, SessionState::SUSPENDED}, |
| 259 {MediaSuspend::DISABLED, BackgroundResuming::DISABLED, SessionState::ACTIVE, | 264 {MediaSuspend::DISABLED, BackgroundResuming::DISABLED, SessionState::ACTIVE, |
| 260 SessionState::ACTIVE}, | 265 SessionState::ACTIVE}, |
| 261 {MediaSuspend::DISABLED, BackgroundResuming::ENABLED, SessionState::ACTIVE, | 266 {MediaSuspend::DISABLED, BackgroundResuming::ENABLED, SessionState::ACTIVE, |
| 262 SessionState::ACTIVE}, | 267 SessionState::ACTIVE}, |
| 263 {MediaSuspend::DISABLED, BackgroundResuming::ENABLED, | 268 {MediaSuspend::DISABLED, BackgroundResuming::ENABLED, |
| 264 SessionState::SUSPENDED, SessionState::SUSPENDED}, | 269 SessionState::SUSPENDED, SessionState::SUSPENDED}, |
| 265 }; | 270 }; |
| 266 | 271 |
| 267 } // anonymous namespace | 272 } // anonymous namespace |
| 268 | 273 |
| 269 IN_PROC_BROWSER_TEST_P(MediaSessionImplVisibilityBrowserTest, TestEntryPoint) { | 274 IN_PROC_BROWSER_TEST_P(MediaSessionImplVisibilityBrowserTest, TestEntryPoint) { |
| 270 StartPlayer(); | 275 StartPlayer(); |
| 271 MaybePausePlayer(); | 276 MaybePausePlayer(); |
| 272 HideTab(); | 277 HideTab(); |
| 273 CheckSessionStateAfterHide(); | 278 CheckSessionStateAfterHide(); |
| 274 } | 279 } |
| 275 | 280 |
| 276 INSTANTIATE_TEST_CASE_P(MediaSessionImplVisibilityBrowserTestInstances, | 281 INSTANTIATE_TEST_CASE_P(MediaSessionImplVisibilityBrowserTestInstances, |
| 277 MediaSessionImplVisibilityBrowserTest, | 282 MediaSessionImplVisibilityBrowserTest, |
| 278 ::testing::ValuesIn(kTestParams)); | 283 ::testing::ValuesIn(kTestParams)); |
| 279 | 284 |
| 280 } // namespace content | 285 } // namespace content |
| OLD | NEW |