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

Unified Diff: chrome_frame/test/chrome_frame_test_utils.h

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/automation_client_mock.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/chrome_frame_test_utils.h
diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h
index 8affbd56431ce148784bc06078eb508b7923ff18..89111887a0fa8f90fff64cf53f6c3799283ac552 100644
--- a/chrome_frame/test/chrome_frame_test_utils.h
+++ b/chrome_frame/test/chrome_frame_test_utils.h
@@ -17,6 +17,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
#include "base/process_util.h"
+#include "base/time.h"
#include "base/test/test_reg_util_win.h"
#include "base/win/registry.h"
#include "base/win/scoped_comptr.h"
@@ -53,8 +54,8 @@ extern const wchar_t kIEImageName[];
extern const wchar_t kIEBrokerImageName[];
extern const char kChromeImageName[];
extern const wchar_t kChromeLauncher[];
-extern const int kChromeFrameLongNavigationTimeoutInSeconds;
-extern const int kChromeFrameVeryLongNavigationTimeoutInSeconds;
+extern const base::TimeDelta kChromeFrameLongNavigationTimeout;
+extern const base::TimeDelta kChromeFrameVeryLongNavigationTimeout;
// Temporarily impersonate the current thread to low integrity for the lifetime
// of the object. Destructor will automatically revert integrity level.
@@ -191,8 +192,8 @@ class TimedMsgLoop {
TimedMsgLoop() : quit_loop_invoked_(false) {
}
- void RunFor(int seconds) {
- QuitAfter(seconds);
+ void RunFor(base::TimeDelta duration) {
+ QuitAfter(duration);
quit_loop_invoked_ = false;
loop_.MessageLoop::Run();
}
@@ -208,13 +209,12 @@ class TimedMsgLoop {
}
void Quit() {
- QuitAfter(0);
+ QuitAfter(base::TimeDelta());
}
- void QuitAfter(int seconds) {
+ void QuitAfter(base::TimeDelta delay) {
quit_loop_invoked_ = true;
- loop_.PostDelayedTask(
- FROM_HERE, MessageLoop::QuitClosure(), 1000 * seconds);
+ loop_.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), delay);
}
bool WasTimedOut() const {
@@ -232,9 +232,9 @@ class TimedMsgLoop {
#define QUIT_LOOP(loop) testing::InvokeWithoutArgs(\
testing::CreateFunctor(&loop, &chrome_frame_test::TimedMsgLoop::Quit))
-#define QUIT_LOOP_SOON(loop, seconds) testing::InvokeWithoutArgs(\
+#define QUIT_LOOP_SOON(loop, delay) testing::InvokeWithoutArgs(\
testing::CreateFunctor(&loop, &chrome_frame_test::TimedMsgLoop::QuitAfter, \
- seconds))
+ delay))
// Launches IE as a COM server and returns the corresponding IWebBrowser2
// interface pointer.
« no previous file with comments | « chrome_frame/test/automation_client_mock.cc ('k') | chrome_frame/test/chrome_frame_test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698