| 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/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 9 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 10 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "content/public/common/content_switches.h" |
| 11 #include "content/public/test/browser_test_utils.h" | 13 #include "content/public/test/browser_test_utils.h" |
| 12 #include "content/public/test/content_browser_test_utils.h" | 14 #include "content/public/test/content_browser_test_utils.h" |
| 13 #include "content/shell/browser/shell.h" | 15 #include "content/shell/browser/shell.h" |
| 14 #include "media/base/test_data_util.h" | 16 #include "media/base/test_data_util.h" |
| 15 #include "net/test/embedded_test_server/embedded_test_server.h" | 17 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 16 | 18 |
| 17 namespace content { | 19 namespace content { |
| 18 | 20 |
| 19 // Common test results. | 21 // Common test results. |
| 20 const char MediaBrowserTest::kEnded[] = "ENDED"; | 22 const char MediaBrowserTest::kEnded[] = "ENDED"; |
| 21 const char MediaBrowserTest::kError[] = "ERROR"; | 23 const char MediaBrowserTest::kError[] = "ERROR"; |
| 22 const char MediaBrowserTest::kFailed[] = "FAILED"; | 24 const char MediaBrowserTest::kFailed[] = "FAILED"; |
| 23 | 25 |
| 26 void MediaBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { |
| 27 command_line->AppendSwitch( |
| 28 switches::kDisableGestureRequirementForMediaPlayback); |
| 29 } |
| 30 |
| 24 void MediaBrowserTest::RunMediaTestPage(const std::string& html_page, | 31 void MediaBrowserTest::RunMediaTestPage(const std::string& html_page, |
| 25 const base::StringPairs& query_params, | 32 const base::StringPairs& query_params, |
| 26 const std::string& expected_title, | 33 const std::string& expected_title, |
| 27 bool http) { | 34 bool http) { |
| 28 GURL gurl; | 35 GURL gurl; |
| 29 std::string query = media::GetURLQueryString(query_params); | 36 std::string query = media::GetURLQueryString(query_params); |
| 30 std::unique_ptr<net::EmbeddedTestServer> http_test_server; | 37 std::unique_ptr<net::EmbeddedTestServer> http_test_server; |
| 31 if (http) { | 38 if (http) { |
| 32 http_test_server.reset(new net::EmbeddedTestServer); | 39 http_test_server.reset(new net::EmbeddedTestServer); |
| 33 http_test_server->ServeFilesFromSourceDirectory(media::GetTestDataPath()); | 40 http_test_server->ServeFilesFromSourceDirectory(media::GetTestDataPath()); |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 } | 287 } |
| 281 | 288 |
| 282 #if defined(OS_CHROMEOS) | 289 #if defined(OS_CHROMEOS) |
| 283 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { | 290 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { |
| 284 RunColorFormatTest("yuv420p.avi", kEnded); | 291 RunColorFormatTest("yuv420p.avi", kEnded); |
| 285 } | 292 } |
| 286 #endif // defined(OS_CHROMEOS) | 293 #endif // defined(OS_CHROMEOS) |
| 287 #endif // defined(USE_PROPRIETARY_CODECS) | 294 #endif // defined(USE_PROPRIETARY_CODECS) |
| 288 | 295 |
| 289 } // namespace content | 296 } // namespace content |
| OLD | NEW |