| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 void CheckSessionStateAfterHide() { | 170 void CheckSessionStateAfterHide() { |
| 171 MediaSessionImpl::State state_before_hide = | 171 MediaSessionImpl::State state_before_hide = |
| 172 ToMediaSessionState(GetVisibilityTestData().session_state_before_hide); | 172 ToMediaSessionState(GetVisibilityTestData().session_state_before_hide); |
| 173 MediaSessionImpl::State state_after_hide = | 173 MediaSessionImpl::State state_after_hide = |
| 174 ToMediaSessionState(GetVisibilityTestData().session_state_after_hide); | 174 ToMediaSessionState(GetVisibilityTestData().session_state_after_hide); |
| 175 | 175 |
| 176 if (state_before_hide == state_after_hide) { | 176 if (state_before_hide == state_after_hide) { |
| 177 LOG(INFO) << "Waiting for 1 second and check session state is unchanged"; | 177 LOG(INFO) << "Waiting for 1 second and check session state is unchanged"; |
| 178 Wait(base::TimeDelta::FromSeconds(1)); | 178 Wait(base::TimeDelta::FromSeconds(1)); |
| 179 ASSERT_EQ(media_session_->audio_focus_state_, state_after_hide); | 179 ASSERT_EQ(state_after_hide, media_session_->audio_focus_state_); |
| 180 } else { | 180 } else { |
| 181 LOG(INFO) << "Waiting for Session to change"; | 181 LOG(INFO) << "Waiting for Session to change"; |
| 182 WaitForMediaSessionState(state_after_hide); | 182 WaitForMediaSessionState(state_after_hide); |
| 183 } | 183 } |
| 184 | 184 |
| 185 LOG(INFO) << "Test succeeded"; | 185 LOG(INFO) << "Test succeeded"; |
| 186 } | 186 } |
| 187 | 187 |
| 188 private: | 188 private: |
| 189 void LoadTestPage() { | 189 void LoadTestPage() { |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 HideTab(); | 292 HideTab(); |
| 293 CheckSessionStateAfterHide(); | 293 CheckSessionStateAfterHide(); |
| 294 } | 294 } |
| 295 | 295 |
| 296 INSTANTIATE_TEST_CASE_P(MediaSessionImplVisibilityBrowserTestInstances, | 296 INSTANTIATE_TEST_CASE_P(MediaSessionImplVisibilityBrowserTestInstances, |
| 297 MediaSessionImplVisibilityBrowserTest, | 297 MediaSessionImplVisibilityBrowserTest, |
| 298 ::testing::Combine(::testing::ValuesIn(kTestParams), | 298 ::testing::Combine(::testing::ValuesIn(kTestParams), |
| 299 ::testing::ValuesIn(kPipelines))); | 299 ::testing::ValuesIn(kPipelines))); |
| 300 | 300 |
| 301 } // namespace content | 301 } // namespace content |
| OLD | NEW |