Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(225)

Unified Diff: content/browser/media/session/media_session_visibility_browsertest.cc

Issue 2108783003: Re-enabling MediaSessionVisibilityBrowserTests for debugging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-enabling MediaSessionVisibilityBrowserTests for debugging Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/session/media_session_visibility_browsertest.cc
diff --git a/content/browser/media/session/media_session_visibility_browsertest.cc b/content/browser/media/session/media_session_visibility_browsertest.cc
index 74d4eb99f335b480a395661fe9868745b1b8026e..659b3c1a4d8b1a6a4c06e2bcb299c916762e6cae 100644
--- a/content/browser/media/session/media_session_visibility_browsertest.cc
+++ b/content/browser/media/session/media_session_visibility_browsertest.cc
@@ -4,6 +4,7 @@
#include "base/command_line.h"
#include "base/location.h"
+#include "base/logging.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "content/browser/media/session/media_session.h"
@@ -109,63 +110,89 @@ class MediaSessionVisibilityBrowserTest
void TestSessionInactiveWhenHiddenAfterContentPause() {
LoadTestPage();
+ LOG(INFO) << "Starting player";
ClearMediaSessionStateLoopRunners();
RunScript(kStartPlayerScript);
+ LOG(INFO) << "Waiting for Session to be active";
WaitForMediaSessionState(MediaSession::State::ACTIVE);
+ LOG(INFO) << "Pausing player";
ClearMediaSessionStateLoopRunners();
RunScript(kPausePlayerScript);
+ LOG(INFO) << "Waiting for Session to be suspended";
WaitForMediaSessionState(MediaSession::State::SUSPENDED);
+ LOG(INFO) << "Hiding the tab";
ClearMediaSessionStateLoopRunners();
web_contents_->WasHidden();
+ LOG(INFO) << "Waiting for Session to be inactive";
WaitForMediaSessionState(MediaSession::State::INACTIVE);
+
+ LOG(INFO) << "Test succeeded";
}
void TestSessionInactiveWhenHiddenWhilePlaying() {
LoadTestPage();
+ LOG(INFO) << "Starting player";
ClearMediaSessionStateLoopRunners();
RunScript(kStartPlayerScript);
+ LOG(INFO) << "Waiting for Session to be active";
WaitForMediaSessionState(MediaSession::State::ACTIVE);
+ LOG(INFO) << "Hiding the tab";
ClearMediaSessionStateLoopRunners();
web_contents_->WasHidden();
+ LOG(INFO) << "Waiting for Session to be inactive";
WaitForMediaSessionState(MediaSession::State::INACTIVE);
+
+ LOG(INFO) << "Test succeeded";
}
void TestSessionSuspendedWhenHiddenAfterContentPause() {
LoadTestPage();
+ LOG(INFO) << "Starting player";
ClearMediaSessionStateLoopRunners();
RunScript(kStartPlayerScript);
+ LOG(INFO) << "Waiting for Session to be active";
WaitForMediaSessionState(MediaSession::State::ACTIVE);
+ LOG(INFO) << "Pausing player";
ClearMediaSessionStateLoopRunners();
RunScript(kPausePlayerScript);
+ LOG(INFO) << "Waiting for Session to be suspended";
WaitForMediaSessionState(MediaSession::State::SUSPENDED);
+ LOG(INFO) << "Hiding the tab";
// Wait for 1 second and check the MediaSession state.
// No better solution till now.
web_contents_->WasHidden();
Wait(base::TimeDelta::FromSeconds(1));
ASSERT_EQ(media_session_->audio_focus_state_,
MediaSession::State::SUSPENDED);
+
+ LOG(INFO) << "Test succeeded";
}
void TestSessionActiveWhenHiddenWhilePlaying() {
LoadTestPage();
+ LOG(INFO) << "Starting player";
ClearMediaSessionStateLoopRunners();
RunScript(kStartPlayerScript);
+ LOG(INFO) << "Waiting for Session to be active";
WaitForMediaSessionState(MediaSession::State::ACTIVE);
+ LOG(INFO) << "Hiding the tab";
// Wait for 1 second and check the MediaSession state.
// No better solution till now.
web_contents_->WasHidden();
Wait(base::TimeDelta::FromSeconds(1));
ASSERT_EQ(media_session_->audio_focus_state_,
MediaSession::State::ACTIVE);
+
+ LOG(INFO) << "Test succeeded";
}
WebContents* web_contents_;
@@ -240,13 +267,14 @@ class MediaSessionVisibilityBrowserTest_AndroidPipeline_SuspendOnHide :
}
};
-// Disabled pending crbug.com/619096.
-// INCLUDE_TEST_FROM_BASE_CLASS(
-// MediaSessionVisibilityBrowserTest_AndroidPipeline_SuspendOnHide,
-// TestSessionInactiveWhenHiddenAfterContentPause)
-// INCLUDE_TEST_FROM_BASE_CLASS(
-// MediaSessionVisibilityBrowserTest_AndroidPipeline_SuspendOnHide,
-// TestSessionInactiveWhenHiddenWhilePlaying)
+// The following tests are flaky. Re-enabling with logging to see what's
+// happening on the bots. See crbug.com/619096.
+INCLUDE_TEST_FROM_BASE_CLASS(
+ MediaSessionVisibilityBrowserTest_AndroidPipeline_SuspendOnHide,
+ TestSessionInactiveWhenHiddenAfterContentPause)
+INCLUDE_TEST_FROM_BASE_CLASS(
+ MediaSessionVisibilityBrowserTest_AndroidPipeline_SuspendOnHide,
+ TestSessionInactiveWhenHiddenWhilePlaying)
// AndroidPipeline + NosuspendOnHide
class MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide :
@@ -258,13 +286,14 @@ class MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide :
}
};
-// Disabled pending crbug.com/619096.
-// INCLUDE_TEST_FROM_BASE_CLASS(
-// MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide,
-// TestSessionSuspendedWhenHiddenAfterContentPause)
-//INCLUDE_TEST_FROM_BASE_CLASS(
-// MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide,
-// TestSessionActiveWhenHiddenWhilePlaying)
+// The following tests are flaky. Re-enabling with logging to see what's
+// happening on the bots. See crbug.com/619096.
+INCLUDE_TEST_FROM_BASE_CLASS(
+ MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide,
+ TestSessionSuspendedWhenHiddenAfterContentPause)
+INCLUDE_TEST_FROM_BASE_CLASS(
+ MediaSessionVisibilityBrowserTest_AndroidPipeline_NosuspendOnHide,
+ TestSessionActiveWhenHiddenWhilePlaying)
#endif // defined(OS_ANDROID)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698