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

Unified Diff: components/autofill/browser/autocheckout_manager_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: components/autofill/browser/autocheckout_manager_unittest.cc
diff --git a/components/autofill/browser/autocheckout_manager_unittest.cc b/components/autofill/browser/autocheckout_manager_unittest.cc
index 14990eef6a5878a5ca26c883c5b06542f2471dbb..530e351a1175f6fd67ebcbd39e77f893e5c7d4e1 100644
--- a/components/autofill/browser/autocheckout_manager_unittest.cc
+++ b/components/autofill/browser/autocheckout_manager_unittest.cc
@@ -22,7 +22,6 @@
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
-
using content::BrowserThread;
namespace autofill {
@@ -334,11 +333,25 @@ class TestAutocheckoutManager: public AutocheckoutManager {
} // namespace
class AutocheckoutManagerTest : public ChromeRenderViewHostTestHarness {
- public:
- AutocheckoutManagerTest()
- : ChromeRenderViewHostTestHarness(),
- ui_thread_(BrowserThread::UI, &message_loop_),
- io_thread_(BrowserThread::IO) {
+ protected:
+ virtual void SetUp() OVERRIDE {
+ SetThreadBundleOptions(content::TestBrowserThreadBundle::REAL_IO_THREAD);
+ ChromeRenderViewHostTestHarness::SetUp();
+ profile()->CreateRequestContext();
+ autofill_manager_delegate_.reset(new MockAutofillManagerDelegate());
+ autofill_manager_.reset(new TestAutofillManager(
+ web_contents(),
+ autofill_manager_delegate_.get()));
+ autocheckout_manager_.reset(
+ new TestAutocheckoutManager(autofill_manager_.get()));
+ }
+
+ virtual void TearDown() OVERRIDE {
+ autocheckout_manager_.reset();
+ autofill_manager_delegate_.reset();
+ autofill_manager_.reset();
+ profile()->ResetRequestContext();
+ ChromeRenderViewHostTestHarness::TearDown();
}
std::vector<FormData> ReadFilledForms() {
@@ -401,35 +414,9 @@ class AutocheckoutManagerTest : public ChromeRenderViewHostTestHarness {
}
protected:
- content::TestBrowserThread ui_thread_;
- content::TestBrowserThread io_thread_;
scoped_ptr<TestAutofillManager> autofill_manager_;
scoped_ptr<TestAutocheckoutManager> autocheckout_manager_;
scoped_ptr<MockAutofillManagerDelegate> autofill_manager_delegate_;
-
- private:
- virtual void SetUp() OVERRIDE {
- ChromeRenderViewHostTestHarness::SetUp();
- io_thread_.StartIOThread();
- profile()->CreateRequestContext();
- autofill_manager_delegate_.reset(new MockAutofillManagerDelegate());
- autofill_manager_.reset(new TestAutofillManager(
- web_contents(),
- autofill_manager_delegate_.get()));
- autocheckout_manager_.reset(
- new TestAutocheckoutManager(autofill_manager_.get()));
- }
-
- virtual void TearDown() OVERRIDE {
- autocheckout_manager_.reset();
- autofill_manager_delegate_.reset();
- autofill_manager_.reset();
- profile()->ResetRequestContext();
- ChromeRenderViewHostTestHarness::TearDown();
- io_thread_.Stop();
- }
-
- DISALLOW_COPY_AND_ASSIGN(AutocheckoutManagerTest);
};
TEST_F(AutocheckoutManagerTest, TestFillForms) {

Powered by Google App Engine
This is Rietveld 408576698