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

Unified Diff: chrome_frame/test/test_with_web_server.cc

Issue 10053004: Use TimeDelta for Chrome Frame test's TimedMsgLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/test/test_with_web_server.h ('k') | chrome_frame/test/ui_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/test_with_web_server.cc
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc
index e01733efdfbab2e351e9ea721a3c464627b4833b..1c87f7b92ec405afcb61e5565f74ef2ecf46ec31 100644
--- a/chrome_frame/test/test_with_web_server.cc
+++ b/chrome_frame/test/test_with_web_server.cc
@@ -24,8 +24,8 @@
#include "net/base/mime_util.h"
#include "net/http/http_util.h"
-using chrome_frame_test::kChromeFrameLongNavigationTimeoutInSeconds;
-using chrome_frame_test::kChromeFrameVeryLongNavigationTimeoutInSeconds;
+using chrome_frame_test::kChromeFrameLongNavigationTimeout;
+using chrome_frame_test::kChromeFrameVeryLongNavigationTimeout;
using testing::_;
using testing::StrCaseEq;
@@ -201,8 +201,9 @@ bool ChromeFrameTestWithWebServer::BringBrowserToTop() {
GetProcessId(browser_handle_));
}
-bool ChromeFrameTestWithWebServer::WaitForTestToComplete(int milliseconds) {
- loop_.RunFor(milliseconds/1000);
+bool ChromeFrameTestWithWebServer::WaitForTestToComplete(
+ base::TimeDelta duration) {
+ loop_.RunFor(duration);
return true;
}
@@ -217,7 +218,7 @@ void ChromeFrameTestWithWebServer::SimpleBrowserTestExpectedResult(
server_mock_.ExpectAndHandlePostedResult(CFInvocation(CFInvocation::NONE),
kPostedResultSubstring);
ASSERT_TRUE(LaunchBrowser(browser, page));
- WaitForTestToComplete(TestTimeouts::action_max_timeout_ms());
+ WaitForTestToComplete(TestTimeouts::action_max_timeout());
ASSERT_EQ(result, server_mock_.posted_result());
}
@@ -264,7 +265,7 @@ void ChromeFrameTestWithWebServer::VersionTest(BrowserKind browser,
server_mock_.ExpectAndHandlePostedResult(CFInvocation(CFInvocation::NONE),
kPostedResultSubstring);
EXPECT_TRUE(LaunchBrowser(browser, page));
- WaitForTestToComplete(TestTimeouts::action_max_timeout_ms());
+ WaitForTestToComplete(TestTimeouts::action_max_timeout());
ASSERT_EQ(version, UTF8ToWide(server_mock_.posted_result()));
}
@@ -669,7 +670,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_InstallFlowTest) {
ASSERT_TRUE(LaunchBrowser(IE, kInstallFlowTestUrl));
- loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds);
+ loop_.RunFor(kChromeFrameLongNavigationTimeout);
ScopedChromeFrameRegistrar::RegisterAtPath(
GetChromeFrameBuildPath().value(),
@@ -677,7 +678,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_InstallFlowTest) {
server_mock_.ExpectAndHandlePostedResult(CFInvocation(CFInvocation::NONE),
kPostedResultSubstring);
- loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds);
+ loop_.RunFor(kChromeFrameLongNavigationTimeout);
chrome_frame_test::CloseAllIEWindows();
ASSERT_EQ("OK", server_mock_.posted_result());
@@ -728,7 +729,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestPostReissue) {
ASSERT_TRUE(LaunchBrowser(IE, server.FormatHttpPath(kPages[0]).c_str()));
- loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds);
+ loop_.RunFor(kChromeFrameLongNavigationTimeout);
const test_server::Request* request = NULL;
server.FindRequest("/quit?OK", &request);
@@ -760,7 +761,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestMultipleGet) {
ASSERT_TRUE(LaunchBrowser(IE, server.FormatHttpPath(kPages[0]).c_str()));
- loop_.RunFor(kChromeFrameVeryLongNavigationTimeoutInSeconds);
+ loop_.RunFor(kChromeFrameVeryLongNavigationTimeout);
const test_server::Request* request = NULL;
server.FindRequest("/quit?OK", &request);
@@ -878,7 +879,7 @@ TEST_F(ChromeFrameTestWithWebServer, FAILS_FullTabModeIE_RefreshMshtmlTest) {
ASSERT_TRUE(LaunchBrowser(IE, server.FormatHttpPath(kPages[0]).c_str()));
- loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds);
+ loop_.RunFor(kChromeFrameLongNavigationTimeout);
test_server::SimpleWebServer* ws = server.web_server();
const test_server::ConnectionList& connections = ws->connections();
@@ -1019,7 +1020,7 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_TestDownloadFromForm) {
std::wstring url(server.FormatHttpPath(L"form.html"));
ASSERT_TRUE(LaunchBrowser(IE, url.c_str()));
- loop_.RunFor(kChromeFrameLongNavigationTimeoutInSeconds);
+ loop_.RunFor(kChromeFrameLongNavigationTimeout);
EXPECT_EQ(1, response->get_request_count());
EXPECT_EQ(1, response->post_request_count());
« no previous file with comments | « chrome_frame/test/test_with_web_server.h ('k') | chrome_frame/test/ui_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698