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

Unified Diff: chrome/browser/net/http_pipelining_compatibility_client_unittest.cc

Issue 14197014: Add TestBrowserThreadBundle into RenderViewHostTestHarness. Kill some unnecessary real threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged ToT Created 7 years, 6 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/net/http_pipelining_compatibility_client_unittest.cc
diff --git a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
index 2f14235e4676b0c4b1b2b352774163feeba76795..9c9d8a63af1f2813d7726d44e84c58223f6f23f4 100644
--- a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
+++ b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc
@@ -10,13 +10,14 @@
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/metrics/histogram_samples.h"
#include "base/metrics/statistics_recorder.h"
+#include "base/run_loop.h"
#include "base/stl_util.h"
#include "base/stringprintf.h"
-#include "content/public/test/test_browser_thread.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/test/test_browser_thread_bundle.h"
#include "net/base/net_errors.h"
#include "net/base/test_completion_callback.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
@@ -81,11 +82,11 @@ using testing::StrEq;
class HttpPipeliningCompatibilityClientTest : public testing::Test {
public:
HttpPipeliningCompatibilityClientTest()
- : test_server_(net::SpawnedTestServer::TYPE_HTTP,
+ : thread_bundle_(content::TestBrowserThreadBundle::IO_MAINLOOP),
+ test_server_(net::SpawnedTestServer::TYPE_HTTP,
net::SpawnedTestServer::kLocalhost,
base::FilePath(FILE_PATH_LITERAL(
- "chrome/test/data/http_pipelining"))),
- io_thread_(BrowserThread::IO, &message_loop_) {
+ "chrome/test/data/http_pipelining"))) {
}
protected:
@@ -109,7 +110,7 @@ class HttpPipeliningCompatibilityClientTest : public testing::Test {
virtual void TearDown() OVERRIDE {
BrowserThread::ReleaseSoon(BrowserThread::IO, FROM_HERE, context_);
- message_loop_.RunUntilIdle();
+ base::RunLoop().RunUntilIdle();
STLDeleteValues(&original_samples_);
}
@@ -204,10 +205,9 @@ class HttpPipeliningCompatibilityClientTest : public testing::Test {
}
}
- base::MessageLoopForIO message_loop_;
+ content::TestBrowserThreadBundle thread_bundle_;
net::SpawnedTestServer test_server_;
net::TestURLRequestContextGetter* context_;
- content::TestBrowserThread io_thread_;
private:
scoped_ptr<HistogramSamples> GetHistogram(const char* name) {
« no previous file with comments | « chrome/browser/net/chrome_network_delegate_unittest.cc ('k') | chrome/browser/net/sqlite_server_bound_cert_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698