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

Unified Diff: components/autofill/browser/autofill_external_delegate_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/autofill_external_delegate_unittest.cc
diff --git a/components/autofill/browser/autofill_external_delegate_unittest.cc b/components/autofill/browser/autofill_external_delegate_unittest.cc
index 331daacb1b90908ce5227a46ad06a95f39d9b6f1..4554844815ef29589fb0529c420ffd38126e5735 100644
--- a/components/autofill/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/browser/autofill_external_delegate_unittest.cc
@@ -15,13 +15,11 @@
#include "components/autofill/common/form_data.h"
#include "components/autofill/common/form_field_data.h"
#include "components/autofill/common/password_form_fill_data.h"
-#include "content/public/test/test_browser_thread.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h"
#include "ui/gfx/rect.h"
-using content::BrowserThread;
using testing::_;
using WebKit::WebAutofillClient;
@@ -92,29 +90,7 @@ class MockAutofillManager : public AutofillManager {
class AutofillExternalDelegateUnitTest
: public ChromeRenderViewHostTestHarness {
- public:
- AutofillExternalDelegateUnitTest()
- : ui_thread_(BrowserThread::UI, &message_loop_) {}
- virtual ~AutofillExternalDelegateUnitTest() {}
-
protected:
- // Issue an OnQuery call with the given |query_id|.
- void IssueOnQuery(int query_id) {
- const FormData form;
- FormFieldData field;
- field.is_focusable = true;
- field.should_autocomplete = true;
- const gfx::RectF element_bounds;
-
- external_delegate_->OnQuery(query_id, form, field, element_bounds, false);
- }
-
- MockAutofillManagerDelegate manager_delegate_;
- scoped_ptr<MockAutofillManager> autofill_manager_;
- scoped_ptr<testing::NiceMock<MockAutofillExternalDelegate> >
- external_delegate_;
-
- private:
virtual void SetUp() OVERRIDE {
ChromeRenderViewHostTestHarness::SetUp();
autofill_manager_.reset(
@@ -135,9 +111,21 @@ class AutofillExternalDelegateUnitTest
ChromeRenderViewHostTestHarness::TearDown();
}
- content::TestBrowserThread ui_thread_;
+ // Issue an OnQuery call with the given |query_id|.
+ void IssueOnQuery(int query_id) {
+ const FormData form;
+ FormFieldData field;
+ field.is_focusable = true;
+ field.should_autocomplete = true;
+ const gfx::RectF element_bounds;
+
+ external_delegate_->OnQuery(query_id, form, field, element_bounds, false);
+ }
- DISALLOW_COPY_AND_ASSIGN(AutofillExternalDelegateUnitTest);
+ MockAutofillManagerDelegate manager_delegate_;
+ scoped_ptr<MockAutofillManager> autofill_manager_;
+ scoped_ptr<testing::NiceMock<MockAutofillExternalDelegate> >
+ external_delegate_;
};
// Test that our external delegate called the virtual methods at the right time.

Powered by Google App Engine
This is Rietveld 408576698