| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/location.h" |
| 7 #include "base/single_thread_task_runner.h" |
| 8 #include "base/threading/thread_task_runner_handle.h" |
| 6 #include "content/browser/media/session/media_session.h" | 9 #include "content/browser/media/session/media_session.h" |
| 7 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
| 8 #include "content/public/common/content_switches.h" | 11 #include "content/public/common/content_switches.h" |
| 9 #include "content/public/test/browser_test_utils.h" | 12 #include "content/public/test/browser_test_utils.h" |
| 10 #include "content/public/test/content_browser_test.h" | 13 #include "content/public/test/content_browser_test.h" |
| 11 #include "content/public/test/content_browser_test_utils.h" | 14 #include "content/public/test/content_browser_test_utils.h" |
| 12 #include "content/public/test/test_navigation_observer.h" | 15 #include "content/public/test/test_navigation_observer.h" |
| 13 #include "content/shell/browser/shell.h" | 16 #include "content/shell/browser/shell.h" |
| 14 #include "media/base/media_switches.h" | 17 #include "media/base/media_switches.h" |
| 15 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 88 |
| 86 void OnMediaSessionStateChanged(MediaSession::State state) { | 89 void OnMediaSessionStateChanged(MediaSession::State state) { |
| 87 ASSERT_TRUE(media_session_state_loop_runners_.count(state)); | 90 ASSERT_TRUE(media_session_state_loop_runners_.count(state)); |
| 88 media_session_state_loop_runners_[state]->Quit(); | 91 media_session_state_loop_runners_[state]->Quit(); |
| 89 } | 92 } |
| 90 | 93 |
| 91 // TODO(zqzhang): This method is shared with | 94 // TODO(zqzhang): This method is shared with |
| 92 // MediaRouterIntegrationTests. Move it into a general place. | 95 // MediaRouterIntegrationTests. Move it into a general place. |
| 93 void Wait(base::TimeDelta timeout) { | 96 void Wait(base::TimeDelta timeout) { |
| 94 base::RunLoop run_loop; | 97 base::RunLoop run_loop; |
| 95 base::MessageLoop::current()->PostDelayedTask( | 98 base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( |
| 96 FROM_HERE, run_loop.QuitClosure(), timeout); | 99 FROM_HERE, run_loop.QuitClosure(), timeout); |
| 97 run_loop.Run(); | 100 run_loop.Run(); |
| 98 } | 101 } |
| 99 | 102 |
| 100 void WaitForMediaSessionState(MediaSession::State state) { | 103 void WaitForMediaSessionState(MediaSession::State state) { |
| 101 ASSERT_TRUE(media_session_state_loop_runners_.count(state)); | 104 ASSERT_TRUE(media_session_state_loop_runners_.count(state)); |
| 102 media_session_state_loop_runners_[state]->Run(); | 105 media_session_state_loop_runners_[state]->Run(); |
| 103 } | 106 } |
| 104 | 107 |
| 105 protected: | 108 protected: |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 INCLUDE_TEST_FROM_BASE_CLASS( | 260 INCLUDE_TEST_FROM_BASE_CLASS( |
| 258 MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, | 261 MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, |
| 259 TestSessionSuspendedWhenHiddenAfterContentPause) | 262 TestSessionSuspendedWhenHiddenAfterContentPause) |
| 260 INCLUDE_TEST_FROM_BASE_CLASS( | 263 INCLUDE_TEST_FROM_BASE_CLASS( |
| 261 MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, | 264 MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, |
| 262 TestSessionActiveWhenHiddenWhilePlaying) | 265 TestSessionActiveWhenHiddenWhilePlaying) |
| 263 | 266 |
| 264 #endif // defined(OS_ANDROID) | 267 #endif // defined(OS_ANDROID) |
| 265 | 268 |
| 266 } // namespace content | 269 } // namespace content |
| OLD | NEW |