| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  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  Loading... | 
|  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 | 
| OLD | NEW |