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/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 gurl = test_server()->GetURL( | 52 gurl = test_server()->GetURL( |
53 base::StringPrintf("files/media/%s?%s", html_page, query.c_str())); | 53 base::StringPrintf("files/media/%s?%s", html_page, query.c_str())); |
54 } else { | 54 } else { |
55 base::FilePath test_file_path = GetTestFilePath("media", html_page); | 55 base::FilePath test_file_path = GetTestFilePath("media", html_page); |
56 gurl = GetFileUrlWithQuery(test_file_path, query); | 56 gurl = GetFileUrlWithQuery(test_file_path, query); |
57 } | 57 } |
58 RunTest(gurl, expected); | 58 RunTest(gurl, expected); |
59 } | 59 } |
60 | 60 |
61 void MediaBrowserTest::RunTest(const GURL& gurl, const char* expected) { | 61 void MediaBrowserTest::RunTest(const GURL& gurl, const char* expected) { |
62 const string16 expected_title = ASCIIToUTF16(expected); | 62 const base::string16 expected_title = ASCIIToUTF16(expected); |
63 DVLOG(1) << "Running test URL: " << gurl; | 63 DVLOG(1) << "Running test URL: " << gurl; |
64 TitleWatcher title_watcher(shell()->web_contents(), expected_title); | 64 TitleWatcher title_watcher(shell()->web_contents(), expected_title); |
65 AddWaitForTitles(&title_watcher); | 65 AddWaitForTitles(&title_watcher); |
66 NavigateToURL(shell(), gurl); | 66 NavigateToURL(shell(), gurl); |
67 | 67 |
68 string16 final_title = title_watcher.WaitAndGetTitle(); | 68 base::string16 final_title = title_watcher.WaitAndGetTitle(); |
69 EXPECT_EQ(expected_title, final_title); | 69 EXPECT_EQ(expected_title, final_title); |
70 } | 70 } |
71 | 71 |
72 void MediaBrowserTest::AddWaitForTitles(content::TitleWatcher* title_watcher) { | 72 void MediaBrowserTest::AddWaitForTitles(content::TitleWatcher* title_watcher) { |
73 title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kEnded)); | 73 title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kEnded)); |
74 title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kError)); | 74 title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kError)); |
75 title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kFailed)); | 75 title_watcher->AlsoWaitForTitle(ASCIIToUTF16(kFailed)); |
76 } | 76 } |
77 | 77 |
78 // Tests playback and seeking of an audio or video file over file or http based | 78 // Tests playback and seeking of an audio or video file over file or http based |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 } | 245 } |
246 | 246 |
247 #if defined(OS_CHROMEOS) | 247 #if defined(OS_CHROMEOS) |
248 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { | 248 IN_PROC_BROWSER_TEST_F(MediaTest, Yuv420pMpeg4) { |
249 RunColorFormatTest("yuv420p.avi", "ENDED"); | 249 RunColorFormatTest("yuv420p.avi", "ENDED"); |
250 } | 250 } |
251 #endif // defined(OS_CHROMEOS) | 251 #endif // defined(OS_CHROMEOS) |
252 #endif // defined(USE_PROPRIETARY_CODECS) | 252 #endif // defined(USE_PROPRIETARY_CODECS) |
253 | 253 |
254 } // namespace content | 254 } // namespace content |
OLD | NEW |