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

Unified Diff: chrome/browser/media/defer_background_media_browsertest.cc

Issue 1293253003: Fix autoplay during prerendering for media elements on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@defer_media
Patch Set: Rename test class. Created 5 years, 4 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 | content/renderer/media/android/webmediaplayer_android.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/media/defer_background_media_browsertest.cc
diff --git a/chrome/browser/media/defer_background_media_browsertest.cc b/chrome/browser/media/defer_background_media_browsertest.cc
index daa3e6b8dc5863f32d03a945af821eb89ee8c8c8..d30178c649a5745c8126cc0a1b0b387953496c8e 100644
--- a/chrome/browser/media/defer_background_media_browsertest.cc
+++ b/chrome/browser/media/defer_background_media_browsertest.cc
@@ -2,21 +2,28 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/command_line.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/test/base/in_process_browser_test.h"
#include "chrome/test/base/ui_test_utils.h"
+#include "content/public/common/content_switches.h"
#include "content/public/test/browser_test_utils.h"
#include "media/base/test_data_util.h"
-// TODO(dalecurtis): Android does not correctly defer media today, fix and
-// enable this test (needs disable of user gesture). http://crbug.com/522157
-#if !defined(OS_ANDROID)
-typedef InProcessBrowserTest MediaBrowserTest;
+class DeferredMediaBrowserTest : public InProcessBrowserTest {
+ public:
+#if defined(OS_ANDROID)
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ command_line->AppendSwitch(
+ switches::kDisableGestureRequirementForMediaPlayback);
+ }
+#endif
+};
-IN_PROC_BROWSER_TEST_F(MediaBrowserTest, BackgroundMediaIsDeferred) {
+IN_PROC_BROWSER_TEST_F(DeferredMediaBrowserTest, BackgroundMediaIsDeferred) {
// Navigate to a video file, which would autoplay in the foreground, but won't
// in the background due to deferred media loading for hidden tabs.
ui_test_utils::NavigateToURLWithDisposition(
@@ -57,4 +64,3 @@ IN_PROC_BROWSER_TEST_F(MediaBrowserTest, BackgroundMediaIsDeferred) {
watcher.AlsoWaitForTitle(ended_str);
EXPECT_EQ(playing_str, watcher.WaitAndGetTitle());
}
-#endif // !defined(OS_ANDROID)
« no previous file with comments | « no previous file | content/renderer/media/android/webmediaplayer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698