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 "content/browser/media/session/media_session.h" | 6 #include "content/browser/media/session/media_session.h" |
7 #include "content/public/browser/web_contents.h" | 7 #include "content/public/browser/web_contents.h" |
8 #include "content/public/common/content_switches.h" | 8 #include "content/public/common/content_switches.h" |
9 #include "content/public/test/browser_test_utils.h" | 9 #include "content/public/test/browser_test_utils.h" |
10 #include "content/public/test/content_browser_test.h" | 10 #include "content/public/test/content_browser_test.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 command_line->AppendSwitch( | 63 command_line->AppendSwitch( |
64 switches::kDisableGestureRequirementForMediaPlayback); | 64 switches::kDisableGestureRequirementForMediaPlayback); |
65 #if !defined(OS_ANDROID) | 65 #if !defined(OS_ANDROID) |
66 command_line->AppendSwitch( | 66 command_line->AppendSwitch( |
67 switches::kEnableDefaultMediaSession); | 67 switches::kEnableDefaultMediaSession); |
68 #endif // !defined(OS_ANDROID) | 68 #endif // !defined(OS_ANDROID) |
69 } | 69 } |
70 | 70 |
71 void LoadTestPage() { | 71 void LoadTestPage() { |
72 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 72 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
73 shell()->LoadURL(GetTestUrl("android/media", "media-session.html")); | 73 shell()->LoadURL(GetTestUrl("media/session", "media-session.html")); |
74 navigation_observer.Wait(); | 74 navigation_observer.Wait(); |
75 } | 75 } |
76 | 76 |
77 void RunScript(const std::string& script) { | 77 void RunScript(const std::string& script) { |
78 ASSERT_TRUE(ExecuteScript(web_contents_->GetMainFrame(), script)); | 78 ASSERT_TRUE(ExecuteScript(web_contents_->GetMainFrame(), script)); |
79 } | 79 } |
80 | 80 |
81 void ClearMediaSessionStateLoopRunners() { | 81 void ClearMediaSessionStateLoopRunners() { |
82 for (auto& state_loop_runner : media_session_state_loop_runners_) | 82 for (auto& state_loop_runner : media_session_state_loop_runners_) |
83 state_loop_runner.second = new MessageLoopRunner(); | 83 state_loop_runner.second = new MessageLoopRunner(); |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
257 INCLUDE_TEST_FROM_BASE_CLASS( | 257 INCLUDE_TEST_FROM_BASE_CLASS( |
258 MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, | 258 MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, |
259 TestSessionSuspendedWhenHiddenAfterContentPause) | 259 TestSessionSuspendedWhenHiddenAfterContentPause) |
260 INCLUDE_TEST_FROM_BASE_CLASS( | 260 INCLUDE_TEST_FROM_BASE_CLASS( |
261 MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, | 261 MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide, |
262 TestSessionActiveWhenHiddenWhilePlaying) | 262 TestSessionActiveWhenHiddenWhilePlaying) |
263 | 263 |
264 #endif // defined(OS_ANDROID) | 264 #endif // defined(OS_ANDROID) |
265 | 265 |
266 } // namespace content | 266 } // namespace content |
OLD | NEW |