OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/string16.h" | 6 #include "base/string16.h" |
7 #include "base/stringprintf.h" | 7 #include "base/stringprintf.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 void PlayMedia(const char* tag, const char* media_file) { | 25 void PlayMedia(const char* tag, const char* media_file) { |
26 GURL player_gurl = GetTestURL(tag, media_file); | 26 GURL player_gurl = GetTestURL(tag, media_file); |
27 | 27 |
28 // Allow the media file to be loaded. | 28 // Allow the media file to be loaded. |
29 const string16 kPlaying = ASCIIToUTF16("PLAYING"); | 29 const string16 kPlaying = ASCIIToUTF16("PLAYING"); |
30 const string16 kFailed = ASCIIToUTF16("FAILED"); | 30 const string16 kFailed = ASCIIToUTF16("FAILED"); |
31 const string16 kError = ASCIIToUTF16("ERROR"); | 31 const string16 kError = ASCIIToUTF16("ERROR"); |
32 ui_test_utils::TitleWatcher title_watcher( | 32 ui_test_utils::TitleWatcher title_watcher( |
33 browser()->GetSelectedWebContents(), kPlaying); | 33 browser()->GetActiveWebContents(), kPlaying); |
34 title_watcher.AlsoWaitForTitle(kFailed); | 34 title_watcher.AlsoWaitForTitle(kFailed); |
35 title_watcher.AlsoWaitForTitle(kError); | 35 title_watcher.AlsoWaitForTitle(kError); |
36 | 36 |
37 ui_test_utils::NavigateToURL(browser(), player_gurl); | 37 ui_test_utils::NavigateToURL(browser(), player_gurl); |
38 | 38 |
39 string16 final_title = title_watcher.WaitAndGetTitle(); | 39 string16 final_title = title_watcher.WaitAndGetTitle(); |
40 EXPECT_EQ(kPlaying, final_title); | 40 EXPECT_EQ(kPlaying, final_title); |
41 } | 41 } |
42 | 42 |
43 void PlayAudio(const char* url) { | 43 void PlayAudio(const char* url) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 static const char* kMediaTests[] = { | 162 static const char* kMediaTests[] = { |
163 "video-autoplay.html", | 163 "video-autoplay.html", |
164 // "video-loop.html", disabled due to 52887. | 164 // "video-loop.html", disabled due to 52887. |
165 "video-no-autoplay.html", | 165 "video-no-autoplay.html", |
166 // TODO(sergeyu): Add more tests here. | 166 // TODO(sergeyu): Add more tests here. |
167 }; | 167 }; |
168 | 168 |
169 for (size_t i = 0; i < arraysize(kMediaTests); ++i) | 169 for (size_t i = 0; i < arraysize(kMediaTests); ++i) |
170 RunLayoutTest(kMediaTests[i]); | 170 RunLayoutTest(kMediaTests[i]); |
171 } | 171 } |
OLD | NEW |