| 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" |
| 11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
| 12 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
| 13 #include "content/public/test/browser_test_utils.h" | 13 #include "content/public/test/browser_test_utils.h" |
| 14 #include "content/public/test/content_browser_test_utils.h" | 14 #include "content/public/test/content_browser_test_utils.h" |
| 15 #include "content/shell/browser/shell.h" | 15 #include "content/shell/browser/shell.h" |
| 16 #include "media/base/media_switches.h" | 16 #include "media/base/media_switches.h" |
| 17 #include "media/base/test_data_util.h" | 17 #include "media/base/test_data_util.h" |
| 18 #include "media/media_features.h" |
| 18 #include "net/test/embedded_test_server/embedded_test_server.h" | 19 #include "net/test/embedded_test_server/embedded_test_server.h" |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 | 22 |
| 22 // Common test results. | 23 // Common test results. |
| 23 const char MediaBrowserTest::kEnded[] = "ENDED"; | 24 const char MediaBrowserTest::kEnded[] = "ENDED"; |
| 24 const char MediaBrowserTest::kError[] = "ERROR"; | 25 const char MediaBrowserTest::kError[] = "ERROR"; |
| 25 const char MediaBrowserTest::kFailed[] = "FAILED"; | 26 const char MediaBrowserTest::kFailed[] = "FAILED"; |
| 26 | 27 |
| 27 void MediaBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { | 28 void MediaBrowserTest::SetUpCommandLine(base::CommandLine* command_line) { |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 #if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_ANDROID) | 135 #if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_ANDROID) |
| 135 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearHighBitDepthVP9) { | 136 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearHighBitDepthVP9) { |
| 136 PlayVideo("bear-320x180-hi10p-vp9.webm", GetParam()); | 137 PlayVideo("bear-320x180-hi10p-vp9.webm", GetParam()); |
| 137 } | 138 } |
| 138 | 139 |
| 139 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBear12DepthVP9) { | 140 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBear12DepthVP9) { |
| 140 PlayVideo("bear-320x180-hi12p-vp9.webm", GetParam()); | 141 PlayVideo("bear-320x180-hi12p-vp9.webm", GetParam()); |
| 141 } | 142 } |
| 142 #endif | 143 #endif |
| 143 | 144 |
| 144 #if defined(USE_PROPRIETARY_CODECS) | 145 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
| 145 // Crashes on Mac only. http://crbug.com/621857 | 146 // Crashes on Mac only. http://crbug.com/621857 |
| 146 #if defined(OS_MACOSX) | 147 #if defined(OS_MACOSX) |
| 147 #define MAYBE_VideoBearMp4 DISABLED_VideoBearMp4 | 148 #define MAYBE_VideoBearMp4 DISABLED_VideoBearMp4 |
| 148 #else | 149 #else |
| 149 #define MAYBE_VideoBearMp4 VideoBearMp4 | 150 #define MAYBE_VideoBearMp4 VideoBearMp4 |
| 150 #endif | 151 #endif |
| 151 IN_PROC_BROWSER_TEST_P(MediaTest, MAYBE_VideoBearMp4) { | 152 IN_PROC_BROWSER_TEST_P(MediaTest, MAYBE_VideoBearMp4) { |
| 152 PlayVideo("bear.mp4", GetParam()); | 153 PlayVideo("bear.mp4", GetParam()); |
| 153 } | 154 } |
| 154 | 155 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 RunVideoSizeTest("bear_rotate_90.mp4", 720, 1280); | 193 RunVideoSizeTest("bear_rotate_90.mp4", 720, 1280); |
| 193 } | 194 } |
| 194 | 195 |
| 195 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated180) { | 196 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated180) { |
| 196 RunVideoSizeTest("bear_rotate_180.mp4", 1280, 720); | 197 RunVideoSizeTest("bear_rotate_180.mp4", 1280, 720); |
| 197 } | 198 } |
| 198 | 199 |
| 199 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated270) { | 200 IN_PROC_BROWSER_TEST_F(MediaTest, VideoBearRotated270) { |
| 200 RunVideoSizeTest("bear_rotate_270.mp4", 720, 1280); | 201 RunVideoSizeTest("bear_rotate_270.mp4", 720, 1280); |
| 201 } | 202 } |
| 202 #endif // defined(USE_PROPRIETARY_CODECS) | 203 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
| 203 | 204 |
| 204 #if defined(OS_CHROMEOS) | 205 #if defined(OS_CHROMEOS) |
| 205 #if defined(USE_PROPRIETARY_CODECS) | 206 #if BUILDFLAG(USE_PROPRIETARY_CODECS) |
| 206 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4) { | 207 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4) { |
| 207 PlayVideo("bear_mpeg4_mp3.avi", GetParam()); | 208 PlayVideo("bear_mpeg4_mp3.avi", GetParam()); |
| 208 } | 209 } |
| 209 | 210 |
| 210 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4Asp) { | 211 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Mpeg4Asp) { |
| 211 PlayVideo("bear_mpeg4asp_mp3.avi", GetParam()); | 212 PlayVideo("bear_mpeg4asp_mp3.avi", GetParam()); |
| 212 } | 213 } |
| 213 | 214 |
| 214 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Divx) { | 215 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearAviMp3Divx) { |
| 215 PlayVideo("bear_divx_mp3.avi", GetParam()); | 216 PlayVideo("bear_divx_mp3.avi", GetParam()); |
| 216 } | 217 } |
| 217 | 218 |
| 218 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBear3gpAacH264) { | 219 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBear3gpAacH264) { |
| 219 PlayVideo("bear_h264_aac.3gp", GetParam()); | 220 PlayVideo("bear_h264_aac.3gp", GetParam()); |
| 220 } | 221 } |
| 221 | 222 |
| 222 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBear3gpAmrnbMpeg4) { | 223 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBear3gpAmrnbMpeg4) { |
| 223 PlayVideo("bear_mpeg4_amrnb.3gp", GetParam()); | 224 PlayVideo("bear_mpeg4_amrnb.3gp", GetParam()); |
| 224 } | 225 } |
| 225 | 226 |
| 226 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavGsmms) { | 227 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavGsmms) { |
| 227 PlayAudio("bear_gsm_ms.wav", GetParam()); | 228 PlayAudio("bear_gsm_ms.wav", GetParam()); |
| 228 } | 229 } |
| 229 #endif // defined(USE_PROPRIETARY_CODECS) | 230 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) |
| 230 #endif // defined(OS_CHROMEOS) | 231 #endif // defined(OS_CHROMEOS) |
| 231 | 232 |
| 232 IN_PROC_BROWSER_TEST_P(MediaTest, AudioBearFlac) { | 233 IN_PROC_BROWSER_TEST_P(MediaTest, AudioBearFlac) { |
| 233 PlayAudio("bear.flac", GetParam()); | 234 PlayAudio("bear.flac", GetParam()); |
| 234 } | 235 } |
| 235 | 236 |
| 236 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavAlaw) { | 237 IN_PROC_BROWSER_TEST_P(MediaTest, VideoBearWavAlaw) { |
| 237 PlayAudio("bear_alaw.wav", GetParam()); | 238 PlayAudio("bear_alaw.wav", GetParam()); |
| 238 } | 239 } |
| 239 | 240 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 261 IN_PROC_BROWSER_TEST_F(MediaTest, Navigate) { | 262 IN_PROC_BROWSER_TEST_F(MediaTest, Navigate) { |
| 262 PlayVideo("bear.webm", false); | 263 PlayVideo("bear.webm", false); |
| 263 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); | 264 NavigateToURL(shell(), GURL(url::kAboutBlankURL)); |
| 264 EXPECT_FALSE(shell()->web_contents()->IsCrashed()); | 265 EXPECT_FALSE(shell()->web_contents()->IsCrashed()); |
| 265 } | 266 } |
| 266 | 267 |
| 267 INSTANTIATE_TEST_CASE_P(File, MediaTest, ::testing::Values(false)); | 268 INSTANTIATE_TEST_CASE_P(File, MediaTest, ::testing::Values(false)); |
| 268 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); | 269 INSTANTIATE_TEST_CASE_P(Http, MediaTest, ::testing::Values(true)); |
| 269 | 270 |
| 270 } // namespace content | 271 } // namespace content |
| OLD | NEW |