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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 command_line->AppendSwitch(switches::kEnableAudioFocus); | 102 command_line->AppendSwitch(switches::kEnableAudioFocus); |
103 #endif // !defined(OS_ANDROID) | 103 #endif // !defined(OS_ANDROID) |
104 | 104 |
105 VisibilityTestData params = GetVisibilityTestData(); | 105 VisibilityTestData params = GetVisibilityTestData(); |
106 | 106 |
107 if (params.media_suspend == MediaSuspend::ENABLED) | 107 if (params.media_suspend == MediaSuspend::ENABLED) |
108 command_line->AppendSwitch(switches::kEnableMediaSuspend); | 108 command_line->AppendSwitch(switches::kEnableMediaSuspend); |
109 else | 109 else |
110 command_line->AppendSwitch(switches::kDisableMediaSuspend); | 110 command_line->AppendSwitch(switches::kDisableMediaSuspend); |
111 | 111 |
112 if (params.background_resuming == BackgroundResuming::ENABLED) { | 112 EnableDisableResumingBackgroundVideos(params.background_resuming == |
113 command_line->AppendSwitchASCII(switches::kEnableFeatures, | 113 BackgroundResuming::ENABLED); |
114 media::kResumeBackgroundVideo.name); | |
115 } else { | |
116 command_line->AppendSwitchASCII(switches::kDisableFeatures, | |
117 media::kResumeBackgroundVideo.name); | |
118 } | |
119 } | 114 } |
120 | 115 |
121 const VisibilityTestData& GetVisibilityTestData() { | 116 const VisibilityTestData& GetVisibilityTestData() { |
122 return GetParam(); | 117 return GetParam(); |
123 } | 118 } |
124 | 119 |
125 void StartPlayer() { | 120 void StartPlayer() { |
126 LoadTestPage(); | 121 LoadTestPage(); |
127 | 122 |
128 LOG(INFO) << "Starting player"; | 123 LOG(INFO) << "Starting player"; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 MaybePausePlayer(); | 265 MaybePausePlayer(); |
271 HideTab(); | 266 HideTab(); |
272 CheckSessionStateAfterHide(); | 267 CheckSessionStateAfterHide(); |
273 } | 268 } |
274 | 269 |
275 INSTANTIATE_TEST_CASE_P(MediaSessionImplVisibilityBrowserTestInstances, | 270 INSTANTIATE_TEST_CASE_P(MediaSessionImplVisibilityBrowserTestInstances, |
276 MediaSessionImplVisibilityBrowserTest, | 271 MediaSessionImplVisibilityBrowserTest, |
277 ::testing::ValuesIn(kTestParams)); | 272 ::testing::ValuesIn(kTestParams)); |
278 | 273 |
279 } // namespace content | 274 } // namespace content |
OLD | NEW |