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

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: fix 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: 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 848a8a058a73919ba0ff79c43569db7ae67e2aac..4b2c60a5adeb2f29ef22a18ef40e5cbeaed0c8bf 100644
--- a/components/autofill/browser/autofill_external_delegate_unittest.cc
+++ b/components/autofill/browser/autofill_external_delegate_unittest.cc
@@ -13,13 +13,11 @@
#include "components/autofill/browser/test_autofill_manager_delegate.h"
#include "components/autofill/common/form_data.h"
#include "components/autofill/common/form_field_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;
@@ -90,29 +88,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(
@@ -133,9 +109,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