summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test/chrome_frame_test_utils.h
diff options
context:
space:
mode:
authorstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 17:02:09 +0000
committerstoyan@chromium.org <stoyan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 17:02:09 +0000
commit290c537c88b3b7ebeec09c4942fc029437ca05e0 (patch)
tree1f85c902daac72b81d5b216b68c3ede80cc53cd4 /chrome_frame/test/chrome_frame_test_utils.h
parent390886f24eb629a8d05ab21cef4764b2cc76c452 (diff)
downloadchromium_src-290c537c88b3b7ebeec09c4942fc029437ca05e0.zip
chromium_src-290c537c88b3b7ebeec09c4942fc029437ca05e0.tar.gz
chromium_src-290c537c88b3b7ebeec09c4942fc029437ca05e0.tar.bz2
Proper notification in OnStopBinding if headers are not availble (i.e. connection failed).
Test added. TEST=chrome_frame_net_tests BUG=none Review URL: http://codereview.chromium.org/593065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/chrome_frame_test_utils.h')
-rw-r--r--chrome_frame/test/chrome_frame_test_utils.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h
index 1cc6e82..8c0983f 100644
--- a/chrome_frame/test/chrome_frame_test_utils.h
+++ b/chrome_frame/test/chrome_frame_test_utils.h
@@ -109,8 +109,11 @@ class LowIntegrityToken {
// We need a UI message loop in the main thread.
class TimedMsgLoop {
public:
+ TimedMsgLoop() : quit_loop_invoked_(false) {}
+
void RunFor(int seconds) {
QuitAfter(seconds);
+ quit_loop_invoked_ = false;
loop_.MessageLoop::Run();
}
@@ -120,14 +123,21 @@ class TimedMsgLoop {
}
void Quit() {
- loop_.PostTask(FROM_HERE, new MessageLoop::QuitTask);
+ QuitAfter(0);
}
void QuitAfter(int seconds) {
+ quit_loop_invoked_ = true;
loop_.PostDelayedTask(FROM_HERE, new MessageLoop::QuitTask, 1000 * seconds);
}
+ bool WasTimedOut() const {
+ return !quit_loop_invoked_;
+ }
+
+ private:
MessageLoopForUI loop_;
+ bool quit_loop_invoked_;
};
// Saves typing. It's somewhat hard to create a wrapper around