| OLD | NEW |
| 1 // Copyright (c) 2009 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 "app/gfx/gl/gl_implementation.h" | 5 #include "app/gfx/gl/gl_implementation.h" |
| 6 #include "base/basictypes.h" | 6 #include "base/basictypes.h" |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.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 | 16 |
| 16 class MediaTest : public UITest { | 17 class MediaTest : public UITest { |
| 17 protected: | 18 protected: |
| 18 virtual void SetUp() { | 19 virtual void SetUp() { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 39 tag, | 40 tag, |
| 40 media_file); | 41 media_file); |
| 41 | 42 |
| 42 NavigateToURL(GURL(url)); | 43 NavigateToURL(GURL(url)); |
| 43 | 44 |
| 44 // Allow the media file to be loaded. | 45 // Allow the media file to be loaded. |
| 45 const std::wstring kPlaying = L"PLAYING"; | 46 const std::wstring kPlaying = L"PLAYING"; |
| 46 const std::wstring kFailed = L"FAILED"; | 47 const std::wstring kFailed = L"FAILED"; |
| 47 const std::wstring kError = L"ERROR"; | 48 const std::wstring kError = L"ERROR"; |
| 48 for (int i = 0; i < 10; ++i) { | 49 for (int i = 0; i < 10; ++i) { |
| 49 base::PlatformThread::Sleep(sleep_timeout_ms()); | 50 base::PlatformThread::Sleep(TestTimeouts::action_timeout_ms()); |
| 50 const std::wstring& title = GetActiveTabTitle(); | 51 const std::wstring& title = GetActiveTabTitle(); |
| 51 if (title == kPlaying || title == kFailed || | 52 if (title == kPlaying || title == kFailed || |
| 52 StartsWith(title, kError, true)) | 53 StartsWith(title, kError, true)) |
| 53 break; | 54 break; |
| 54 } | 55 } |
| 55 | 56 |
| 56 EXPECT_EQ(kPlaying, GetActiveTabTitle()); | 57 EXPECT_EQ(kPlaying, GetActiveTabTitle()); |
| 57 } | 58 } |
| 58 | 59 |
| 59 void PlayAudio(const char* url) { | 60 void PlayAudio(const char* url) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 InitializeForLayoutTest(test_dir, media_test_dir, kNoHttpPort); | 126 InitializeForLayoutTest(test_dir, media_test_dir, kNoHttpPort); |
| 126 | 127 |
| 127 // Copy resources first. | 128 // Copy resources first. |
| 128 for (size_t i = 0; i < arraysize(kResources); ++i) | 129 for (size_t i = 0; i < arraysize(kResources); ++i) |
| 129 AddResourceForLayoutTest( | 130 AddResourceForLayoutTest( |
| 130 test_dir, media_test_dir.AppendASCII(kResources[i])); | 131 test_dir, media_test_dir.AppendASCII(kResources[i])); |
| 131 | 132 |
| 132 for (size_t i = 0; i < arraysize(kMediaTests); ++i) | 133 for (size_t i = 0; i < arraysize(kMediaTests); ++i) |
| 133 RunLayoutTest(kMediaTests[i], kNoHttpPort); | 134 RunLayoutTest(kMediaTests[i], kNoHttpPort); |
| 134 } | 135 } |
| OLD | NEW |