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

Unified Diff: chrome_frame/test/chrome_frame_test_utils.h

Issue 10007043: Attempt to fix ChromeFrameTestWithWebServer tests. (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 | « no previous file | chrome_frame/test/test_with_web_server.h » ('j') | chrome_frame/test/test_with_web_server.cc » ('J')
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..17f06ed2ff28c13eb0e1ef40f6e31510177ed314 100644
--- a/chrome_frame/test/chrome_frame_test_utils.h
+++ b/chrome_frame/test/chrome_frame_test_utils.h
@@ -13,6 +13,7 @@
#include <string>
#include "base/basictypes.h"
+#include "base/cancelable_callback.h"
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
@@ -195,6 +196,7 @@ class TimedMsgLoop {
QuitAfter(seconds);
quit_loop_invoked_ = false;
loop_.MessageLoop::Run();
+ quit_closure_.Cancel();
}
void PostTask(const tracked_objects::Location& from_here,
@@ -212,17 +214,23 @@ class TimedMsgLoop {
}
void QuitAfter(int seconds) {
+ quit_closure_.Reset(MessageLoop::QuitClosure());
quit_loop_invoked_ = true;
loop_.PostDelayedTask(
- FROM_HERE, MessageLoop::QuitClosure(), 1000 * seconds);
+ FROM_HERE, quit_closure_.callback(), 1000 * seconds);
}
bool WasTimedOut() const {
return !quit_loop_invoked_;
}
+ void RunAllPending() {
+ loop_.RunAllPending();
+ }
+
private:
MessageLoopForUI loop_;
+ base::CancelableClosure quit_closure_;
bool quit_loop_invoked_;
};
« no previous file with comments | « no previous file | chrome_frame/test/test_with_web_server.h » ('j') | chrome_frame/test/test_with_web_server.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698