OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "content/browser/media/media_browsertest.h" | 5 #include "content/browser/media/media_browsertest.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 const char MediaBrowserTest::kFailed[] = "FAILED"; | 28 const char MediaBrowserTest::kFailed[] = "FAILED"; |
29 | 29 |
30 // Upper case event name set by Utils.installTitleEventHandler(). | 30 // Upper case event name set by Utils.installTitleEventHandler(). |
31 const char MediaBrowserTest::kEnded[] = "ENDED"; | 31 const char MediaBrowserTest::kEnded[] = "ENDED"; |
32 const char MediaBrowserTest::kErrorEvent[] = "ERROR"; | 32 const char MediaBrowserTest::kErrorEvent[] = "ERROR"; |
33 | 33 |
34 // Lower case event name as set by Utils.failTest(). | 34 // Lower case event name as set by Utils.failTest(). |
35 const char MediaBrowserTest::kError[] = "error"; | 35 const char MediaBrowserTest::kError[] = "error"; |
36 | 36 |
37 void MediaBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { | 37 void MediaBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { |
38 command_line->AppendSwitch(switches::kIgnoreAutoplayRestrictionsForTests); | 38 command_line->AppendSwitch( |
| 39 switches::kDisableGestureRequirementForMediaPlayback); |
39 command_line->AppendSwitch(switches::kEnableVp9InMp4); | 40 command_line->AppendSwitch(switches::kEnableVp9InMp4); |
40 } | 41 } |
41 | 42 |
42 void MediaBrowserTest::RunMediaTestPage(const std::string& html_page, | 43 void MediaBrowserTest::RunMediaTestPage(const std::string& html_page, |
43 const base::StringPairs& query_params, | 44 const base::StringPairs& query_params, |
44 const std::string& expected_title, | 45 const std::string& expected_title, |
45 bool http) { | 46 bool http) { |
46 GURL gurl; | 47 GURL gurl; |
47 std::string query = media::GetURLQueryString(query_params); | 48 std::string query = media::GetURLQueryString(query_params); |
48 std::unique_ptr<net::EmbeddedTestServer> http_test_server; | 49 std::unique_ptr<net::EmbeddedTestServer> http_test_server; |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 IN_PROC_BROWSER_TEST_F(MediaTest, Navigate) { | 300 IN_PROC_BROWSER_TEST_F(MediaTest, Navigate) { |
300 PlayVideo("bear.webm", false); | 301 PlayVideo("bear.webm", false); |
301 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); | 302 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); |
302 EXPECT_FALSE(shell()->web_contents()->IsCrashed()); | 303 EXPECT_FALSE(shell()->web_contents()->IsCrashed()); |
303 } | 304 } |
304 | 305 |
305 INSTANTIATE_TEST_CASE_P(File, MediaTest, ::testing::Values(false)); | 306 INSTANTIATE_TEST_CASE_P(File, MediaTest, ::testing::Values(false)); |
306 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); | 307 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); |
307 | 308 |
308 } // namespace content | 309 } // namespace content |
OLD | NEW |