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

Unified Diff: chrome/browser/extensions/activity_log/activity_log_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: address jyasskin's comments\ Created 7 years, 7 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/activity_log/activity_log_unittest.cc
diff --git a/chrome/browser/extensions/activity_log/activity_log_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_unittest.cc
index 62ab52ad0d6cb1c3c8feee4b4c9b734ff98e03f3..cd41b81a2d41bcfc27aae4e2948e267c52ee30f2 100644
--- a/chrome/browser/extensions/activity_log/activity_log_unittest.cc
+++ b/chrome/browser/extensions/activity_log/activity_log_unittest.cc
@@ -14,7 +14,6 @@
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "content/public/browser/browser_thread.h"
-#include "content/public/test/test_browser_thread.h"
#include "sql/statement.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -28,13 +27,11 @@ namespace extensions {
class ActivityLogTest : public ChromeRenderViewHostTestHarness {
public:
- ActivityLogTest()
- : ui_thread_(BrowserThread::UI, MessageLoop::current()),
- db_thread_(BrowserThread::DB, MessageLoop::current()),
- file_thread_(BrowserThread::FILE, MessageLoop::current()) {}
-
virtual void SetUp() OVERRIDE {
ChromeRenderViewHostTestHarness::SetUp();
+#if defined OS_CHROMEOS
+ test_user_manager_.reset(new chromeos::ScopedTestUserManager());
+#endif
CommandLine command_line(CommandLine::NO_PROGRAM);
profile_ =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
@@ -48,9 +45,11 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
ActivityLog::RecomputeLoggingIsEnabled();
}
- virtual ~ActivityLogTest() {
- MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure());
- MessageLoop::current()->Run();
+ virtual void TearDown() OVERRIDE {
+#if defined OS_CHROMEOS
+ test_user_manager_.reset();
+#endif
+ ChromeRenderViewHostTestHarness::TearDown();
}
static void RetrieveActions_LogAndFetchActions(
@@ -78,15 +77,10 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness {
ExtensionService* extension_service_;
Profile* profile_;
- private:
- content::TestBrowserThread ui_thread_;
- content::TestBrowserThread db_thread_;
- content::TestBrowserThread file_thread_;
-
#if defined OS_CHROMEOS
chromeos::ScopedTestDeviceSettingsService test_device_settings_service_;
chromeos::ScopedTestCrosSettings test_cros_settings_;
- chromeos::ScopedTestUserManager test_user_manager_;
+ scoped_ptr<chromeos::ScopedTestUserManager> test_user_manager_;
#endif
};

Powered by Google App Engine
This is Rietveld 408576698