Chromium Code Reviews| Index: content/browser/media/session/media_session_integration_browsertest_base.h |
| diff --git a/content/browser/media/session/media_session_integration_browsertest_base.h b/content/browser/media/session/media_session_integration_browsertest_base.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..2f75caefda47da7f75976c376047ee5b2ed04811 |
| --- /dev/null |
| +++ b/content/browser/media/session/media_session_integration_browsertest_base.h |
| @@ -0,0 +1,57 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_INTEGRATION_BROWSER_TEST_BASE_H_ |
| +#define CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_INTEGRATION_BROWSER_TEST_BASE_H_ |
| + |
| +#include "content/public/test/content_browser_test.h" |
| +namespace base { |
|
mlamouri (slow - plz ping)
2016/03/23 15:10:16
style: I believe you are missing a line between th
Zhiqiang Zhang (Slow)
2016/03/24 18:16:49
Done.
|
| +class CommandLine; |
| +class TimeDelta; |
| +} |
| + |
| +namespace content { |
| + |
| +class WebContents; |
| +class MediaSession; |
| + |
| +class MediaSessionIntegrationBrowserTestBase |
|
mlamouri (slow - plz ping)
2016/03/23 15:10:16
nit: I would call this MediaSessionVisibilityBrows
Zhiqiang Zhang (Slow)
2016/03/24 18:16:49
Done.
|
| + : public ContentBrowserTest { |
| + public: |
| + MediaSessionIntegrationBrowserTestBase() = default; |
| + |
| + void SetUpOnMainThread() override; |
| + |
| + void SetUpCommandLine(base::CommandLine* command_line) override; |
| + |
| + void LoadTestPage(); |
| + |
| + void RunScript(std::string script); |
| + |
| + // TODO(zqzhang): This method is shared with |
| + // MediaIntegrationTests. Move it into a general place. |
| + bool ConditionalWait(base::TimeDelta timeout, |
| + base::TimeDelta interval, |
| + const base::Callback<bool(void)>& callback); |
| + |
| + bool IsMediaSessionActive(); |
| + bool IsMediaSessionSuspended(); |
| + bool IsMediaSessionInactive(); |
| + |
| + protected: |
| + void TestSessionInactiveWhenHiddenAfterContentPause(); |
| + void TestSessionInactiveWhenHiddenWhilePlaying(); |
| + |
| + WebContents* web_contents_; |
| + MediaSession* media_session_; |
| +}; |
| + |
| +} // namespace content |
| + |
| +#define INCLUDE_TEST_FROM_BASE_CLASS(test_fixture, test_name) \ |
| + IN_PROC_BROWSER_TEST_F(test_fixture, test_name) {\ |
| + test_name();\ |
| + } |
| + |
| +#endif // CONTENT_BROWSER_MEDIA_SESSION_MEDIA_SESSION_INTEGRATION_BROWSER_TEST_BASE_H_ |