OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/file_path.h" | 6 #include "base/file_path.h" |
| 7 #include "base/stringprintf.h" |
7 #include "base/string_util.h" | 8 #include "base/string_util.h" |
8 #include "base/test/test_timeouts.h" | 9 #include "base/test/test_timeouts.h" |
9 #include "base/threading/platform_thread.h" | 10 #include "base/threading/platform_thread.h" |
10 #include "chrome/common/chrome_switches.h" | 11 #include "chrome/common/chrome_switches.h" |
11 #include "chrome/test/test_launcher_utils.h" | 12 #include "chrome/test/test_launcher_utils.h" |
12 #include "chrome/test/ui/ui_layout_test.h" | 13 #include "chrome/test/ui/ui_layout_test.h" |
13 #include "chrome/test/ui/ui_test.h" | 14 #include "chrome/test/ui/ui_test.h" |
14 #include "net/base/net_util.h" | 15 #include "net/base/net_util.h" |
15 #include "ui/gfx/gl/gl_implementation.h" | 16 #include "ui/gfx/gl/gl_implementation.h" |
16 | 17 |
(...skipping 11 matching lines...) Expand all Loading... |
28 #endif | 29 #endif |
29 | 30 |
30 UITest::SetUp(); | 31 UITest::SetUp(); |
31 } | 32 } |
32 | 33 |
33 void PlayMedia(const char* tag, const char* media_file) { | 34 void PlayMedia(const char* tag, const char* media_file) { |
34 FilePath test_file(test_data_directory_); | 35 FilePath test_file(test_data_directory_); |
35 test_file = test_file.AppendASCII("media/player.html"); | 36 test_file = test_file.AppendASCII("media/player.html"); |
36 | 37 |
37 GURL player_gurl = net::FilePathToFileURL(test_file); | 38 GURL player_gurl = net::FilePathToFileURL(test_file); |
38 std::string url = StringPrintf("%s?%s=%s", | 39 std::string url = base::StringPrintf( |
39 player_gurl.spec().c_str(), | 40 "%s?%s=%s", player_gurl.spec().c_str(), tag, media_file); |
40 tag, | |
41 media_file); | |
42 | 41 |
43 NavigateToURL(GURL(url)); | 42 NavigateToURL(GURL(url)); |
44 | 43 |
45 // Allow the media file to be loaded. | 44 // Allow the media file to be loaded. |
46 const std::wstring kPlaying = L"PLAYING"; | 45 const std::wstring kPlaying = L"PLAYING"; |
47 const std::wstring kFailed = L"FAILED"; | 46 const std::wstring kFailed = L"FAILED"; |
48 const std::wstring kError = L"ERROR"; | 47 const std::wstring kError = L"ERROR"; |
49 for (int i = 0; i < 10; ++i) { | 48 for (int i = 0; i < 10; ++i) { |
50 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); | 49 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); |
51 const std::wstring& title = GetActiveTabTitle(); | 50 const std::wstring& title = GetActiveTabTitle(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 InitializeForLayoutTest(test_dir, media_test_dir, kNoHttpPort); | 118 InitializeForLayoutTest(test_dir, media_test_dir, kNoHttpPort); |
120 | 119 |
121 // Copy resources first. | 120 // Copy resources first. |
122 for (size_t i = 0; i < arraysize(kResources); ++i) | 121 for (size_t i = 0; i < arraysize(kResources); ++i) |
123 AddResourceForLayoutTest( | 122 AddResourceForLayoutTest( |
124 test_dir, media_test_dir.AppendASCII(kResources[i])); | 123 test_dir, media_test_dir.AppendASCII(kResources[i])); |
125 | 124 |
126 for (size_t i = 0; i < arraysize(kMediaTests); ++i) | 125 for (size_t i = 0; i < arraysize(kMediaTests); ++i) |
127 RunLayoutTest(kMediaTests[i], kNoHttpPort); | 126 RunLayoutTest(kMediaTests[i], kNoHttpPort); |
128 } | 127 } |
OLD | NEW |