| Index: chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
|
| diff --git a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
|
| index 48e65212395d73b6cb9e53cb78535619ca6e735e..43afeefc9fb7e380920e35f504e5fcb713bd8f2f 100644
|
| --- a/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
|
| +++ b/chrome/browser/ui/autofill/autofill_dialog_controller_unittest.cc
|
| @@ -6,6 +6,7 @@
|
| #include "base/memory/scoped_ptr.h"
|
| #include "base/message_loop.h"
|
| #include "base/prefs/pref_service.h"
|
| +#include "base/run_loop.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h"
|
| #include "chrome/browser/ui/autofill/autofill_dialog_view.h"
|
| @@ -22,7 +23,7 @@
|
| #include "components/autofill/browser/wallet/wallet_test_util.h"
|
| #include "components/autofill/common/form_data.h"
|
| #include "content/public/browser/web_contents.h"
|
| -#include "content/public/test/test_browser_thread.h"
|
| +#include "content/public/test/test_browser_thread_bundle.h"
|
| #include "content/public/test/web_contents_tester.h"
|
| #include "testing/gmock/include/gmock/gmock.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| @@ -44,8 +45,6 @@ const char* kFieldsFromPage[] =
|
| { "email", "cc-number", "billing region", "shipping region" };
|
| const char kSettingsOrigin[] = "Chrome settings";
|
|
|
| -using content::BrowserThread;
|
| -
|
| void SetOutputValue(const DetailInputs& inputs,
|
| DetailOutputMap* outputs,
|
| AutofillFieldType type,
|
| @@ -282,19 +281,7 @@ class TestAutofillDialogController
|
| };
|
|
|
| class AutofillDialogControllerTest : public testing::Test {
|
| - public:
|
| - AutofillDialogControllerTest()
|
| - : ui_thread_(BrowserThread::UI, &loop_),
|
| - file_thread_(BrowserThread::FILE),
|
| - file_blocking_thread_(BrowserThread::FILE_USER_BLOCKING),
|
| - io_thread_(BrowserThread::IO) {
|
| - file_thread_.Start();
|
| - file_blocking_thread_.Start();
|
| - io_thread_.StartIOThread();
|
| - }
|
| -
|
| - virtual ~AutofillDialogControllerTest() {}
|
| -
|
| + protected:
|
| // testing::Test implementation:
|
| virtual void SetUp() OVERRIDE {
|
| FormData form_data;
|
| @@ -384,18 +371,14 @@ class AutofillDialogControllerTest : public testing::Test {
|
| form_structure_ = form_structure;
|
| }
|
|
|
| + // Must be first member to ensure TestBrowserThreads outlive other objects.
|
| + content::TestBrowserThreadBundle thread_bundle_;
|
| +
|
| #if defined(OS_WIN)
|
| // http://crbug.com/227221
|
| ui::ScopedOleInitializer ole_initializer_;
|
| #endif
|
|
|
| - // A bunch of threads are necessary for classes like TestWebContents and
|
| - // URLRequestContextGetter not to fall over.
|
| - base::MessageLoopForUI loop_;
|
| - content::TestBrowserThread ui_thread_;
|
| - content::TestBrowserThread file_thread_;
|
| - content::TestBrowserThread file_blocking_thread_;
|
| - content::TestBrowserThread io_thread_;
|
| TestingProfile profile_;
|
|
|
| // The controller owns itself.
|
| @@ -408,8 +391,6 @@ class AutofillDialogControllerTest : public testing::Test {
|
|
|
| // Returned when the dialog closes successfully.
|
| const FormStructure* form_structure_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(AutofillDialogControllerTest);
|
| };
|
|
|
| } // namespace
|
|
|