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

Unified Diff: chrome/browser/sync/glue/http_bridge_unittest.cc

Issue 306032: Simplify threading in browser thread by making only ChromeThread deal with di... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: a few more simplifications Created 11 years, 2 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
Index: chrome/browser/sync/glue/http_bridge_unittest.cc
===================================================================
--- chrome/browser/sync/glue/http_bridge_unittest.cc (revision 30037)
+++ chrome/browser/sync/glue/http_bridge_unittest.cc (working copy)
@@ -5,6 +5,7 @@
#if defined(BROWSER_SYNC)
#include "base/thread.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/sync/glue/http_bridge.h"
#include "net/url_request/url_request_unittest.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -32,7 +33,7 @@
public:
HttpBridgeTest()
: fake_default_request_context_getter_(NULL),
- io_thread_("HttpBridgeTest IO thread") {
+ io_thread_(ChromeThread::IO) {
}
virtual void SetUp() {
@@ -55,9 +56,7 @@
}
HttpBridge* bridge = new HttpBridge(
new HttpBridge::RequestContextGetter(
- fake_default_request_context_getter_),
- io_thread_loop());
- bridge->use_io_loop_for_testing_ = true;
+ fake_default_request_context_getter_));
return bridge;
}
@@ -74,7 +73,8 @@
TestURLRequestContextGetter* fake_default_request_context_getter_;
// Separate thread for IO used by the HttpBridge.
- base::Thread io_thread_;
+ ChromeThread io_thread_;
+
};
// An HttpBridge that doesn't actually make network requests and just calls
@@ -82,10 +82,10 @@
class ShuntedHttpBridge : public HttpBridge {
public:
ShuntedHttpBridge(URLRequestContextGetter* baseline_context_getter,
- MessageLoop* io_loop, HttpBridgeTest* test)
+ HttpBridgeTest* test)
: HttpBridge(new HttpBridge::RequestContextGetter(
- baseline_context_getter),
- io_loop), test_(test) { }
+ baseline_context_getter)),
+ test_(test) { }
protected:
virtual void MakeAsynchronousPost() {
ASSERT_TRUE(MessageLoop::current() == test_->io_thread_loop());
@@ -124,7 +124,7 @@
scoped_refptr<URLRequestContextGetter> ctx_getter(
new TestURLRequestContextGetter());
scoped_refptr<HttpBridge> http_bridge(new ShuntedHttpBridge(
- ctx_getter, io_thread_loop(), this));
+ ctx_getter, this));
http_bridge->SetUserAgent("bob");
http_bridge->SetURL("http://www.google.com", 9999);
http_bridge->SetPostPayload("text/plain", 2, " ");

Powered by Google App Engine
This is Rietveld 408576698