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

Unified Diff: chrome/browser/extensions/extension_updater_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/extensions/extension_updater_unittest.cc
===================================================================
--- chrome/browser/extensions/extension_updater_unittest.cc (revision 30037)
+++ chrome/browser/extensions/extension_updater_unittest.cc (working copy)
@@ -9,6 +9,7 @@
#include "base/stl_util-inl.h"
#include "base/string_util.h"
#include "base/thread.h"
+#include "chrome/browser/chrome_thread.h"
#include "chrome/browser/extensions/extension_updater.h"
#include "chrome/browser/extensions/extensions_service.h"
#include "chrome/browser/net/test_url_fetcher_factory.h"
@@ -234,9 +235,12 @@
service.set_extensions(tmp);
// Setup and start the updater.
+ MessageLoop message_loop;
+ ChromeThread io_thread(ChromeThread::IO);
+ io_thread.Start();
+
TestURLFetcherFactory factory;
URLFetcher::set_factory(&factory);
- MessageLoop message_loop;
ScopedTempPrefService prefs;
scoped_refptr<ExtensionUpdater> updater =
new ExtensionUpdater(&service, prefs.get(), 60*60*24, NULL, NULL);
@@ -277,9 +281,12 @@
ServiceForManifestTests service;
// Setup and start the updater.
+ MessageLoop message_loop;
+ ChromeThread io_thread(ChromeThread::IO);
+ io_thread.Start();
+
TestURLFetcherFactory factory;
URLFetcher::set_factory(&factory);
- MessageLoop message_loop;
ScopedTempPrefService prefs;
scoped_refptr<ExtensionUpdater> updater =
new ExtensionUpdater(&service, prefs.get(), 60*60*24, NULL, NULL);
@@ -349,15 +356,16 @@
}
static void TestMultipleManifestDownloading() {
+ MessageLoop ui_loop;
+ ChromeThread file_thread(ChromeThread::FILE);
+ file_thread.Start();
+ ChromeThread io_thread(ChromeThread::IO);
+ io_thread.Start();
+
TestURLFetcherFactory factory;
TestURLFetcher* fetcher = NULL;
URLFetcher::set_factory(&factory);
ServiceForDownloadTests service;
- MessageLoop ui_loop;
- base::Thread file_thread("File Thread");
- ASSERT_TRUE(file_thread.Start());
- base::Thread io_thread("IO Thread");
- ASSERT_TRUE(io_thread.Start());
ScopedTempPrefService prefs;
scoped_refptr<ExtensionUpdater> updater =
new ExtensionUpdater(&service, prefs.get(), kUpdateFrequencySecs,
@@ -410,8 +418,10 @@
static void TestSingleExtensionDownloading() {
MessageLoop ui_loop;
- base::Thread file_thread("File Thread");
- ASSERT_TRUE(file_thread.Start());
+ ChromeThread file_thread(ChromeThread::FILE);
+ file_thread.Start();
+ ChromeThread io_thread(ChromeThread::IO);
+ io_thread.Start();
TestURLFetcherFactory factory;
TestURLFetcher* fetcher = NULL;
@@ -457,6 +467,9 @@
static void TestBlacklistDownloading() {
MessageLoop message_loop;
+ ChromeThread io_thread(ChromeThread::IO);
+ io_thread.Start();
+
TestURLFetcherFactory factory;
TestURLFetcher* fetcher = NULL;
URLFetcher::set_factory(&factory);
@@ -501,6 +514,9 @@
static void TestMultipleExtensionDownloading() {
MessageLoopForUI message_loop;
+ ChromeThread io_thread(ChromeThread::IO);
+ io_thread.Start();
+
TestURLFetcherFactory factory;
TestURLFetcher* fetcher = NULL;
URLFetcher::set_factory(&factory);

Powered by Google App Engine
This is Rietveld 408576698