Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: chrome/browser/media_uitest.cc

Issue 9233018: Convert use of int ms to TimeDelta in files owned by brettw. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase onto master. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/intranet_redirect_detector.cc ('k') | chrome/browser/omnibox_search_hint.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/stringprintf.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/test/test_timeouts.h" 9 #include "base/test/test_timeouts.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 13 matching lines...) Expand all
24 GURL player_gurl = net::FilePathToFileURL(test_file); 24 GURL player_gurl = net::FilePathToFileURL(test_file);
25 std::string url = base::StringPrintf( 25 std::string url = base::StringPrintf(
26 "%s?%s=%s", player_gurl.spec().c_str(), tag, media_file); 26 "%s?%s=%s", player_gurl.spec().c_str(), tag, media_file);
27 27
28 NavigateToURL(GURL(url)); 28 NavigateToURL(GURL(url));
29 29
30 // Allow the media file to be loaded. 30 // Allow the media file to be loaded.
31 const std::wstring kPlaying = L"PLAYING"; 31 const std::wstring kPlaying = L"PLAYING";
32 const std::wstring kFailed = L"FAILED"; 32 const std::wstring kFailed = L"FAILED";
33 const std::wstring kError = L"ERROR"; 33 const std::wstring kError = L"ERROR";
34 const int kSleepIntervalMs = 250; 34 const base::TimeDelta kSleepInterval =
35 base::TimeDelta::FromMilliseconds(250);
35 const int kNumIntervals = 36 const int kNumIntervals =
36 TestTimeouts::action_timeout_ms() / kSleepIntervalMs; 37 TestTimeouts::action_timeout() / kSleepInterval;
37 for (int i = 0; i < kNumIntervals; ++i) { 38 for (int i = 0; i < kNumIntervals; ++i) {
38 const std::wstring& title = GetActiveTabTitle(); 39 const std::wstring& title = GetActiveTabTitle();
39 if (title == kPlaying || title == kFailed || 40 if (title == kPlaying || title == kFailed ||
40 StartsWith(title, kError, true)) 41 StartsWith(title, kError, true))
41 break; 42 break;
42 base::PlatformThread::Sleep(kSleepIntervalMs); 43 base::PlatformThread::Sleep(kSleepInterval);
43 } 44 }
44 45
45 EXPECT_EQ(kPlaying, GetActiveTabTitle()); 46 EXPECT_EQ(kPlaying, GetActiveTabTitle());
46 } 47 }
47 48
48 void PlayAudio(const char* url) { 49 void PlayAudio(const char* url) {
49 PlayMedia("audio", url); 50 PlayMedia("audio", url);
50 } 51 }
51 52
52 void PlayVideo(const char* url) { 53 void PlayVideo(const char* url) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 InitializeForLayoutTest(test_dir, media_test_dir, kNoHttpPort); 156 InitializeForLayoutTest(test_dir, media_test_dir, kNoHttpPort);
156 157
157 // Copy resources first. 158 // Copy resources first.
158 for (size_t i = 0; i < arraysize(kResources); ++i) 159 for (size_t i = 0; i < arraysize(kResources); ++i)
159 AddResourceForLayoutTest( 160 AddResourceForLayoutTest(
160 test_dir, media_test_dir.AppendASCII(kResources[i])); 161 test_dir, media_test_dir.AppendASCII(kResources[i]));
161 162
162 for (size_t i = 0; i < arraysize(kMediaTests); ++i) 163 for (size_t i = 0; i < arraysize(kMediaTests); ++i)
163 RunLayoutTest(kMediaTests[i], kNoHttpPort); 164 RunLayoutTest(kMediaTests[i], kNoHttpPort);
164 } 165 }
OLDNEW
« no previous file with comments | « chrome/browser/intranet_redirect_detector.cc ('k') | chrome/browser/omnibox_search_hint.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698