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

Side by Side Diff: chrome/browser/autofill/autofill_manager_unittest.cc

Issue 11636040: AutofillPopupController clarifications + simplifications. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ilya review Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "content/public/test/test_browser_thread.h" 44 #include "content/public/test/test_browser_thread.h"
45 #include "googleurl/src/gurl.h" 45 #include "googleurl/src/gurl.h"
46 #include "grit/generated_resources.h" 46 #include "grit/generated_resources.h"
47 #include "ipc/ipc_test_sink.h" 47 #include "ipc/ipc_test_sink.h"
48 #include "testing/gmock/include/gmock/gmock.h" 48 #include "testing/gmock/include/gmock/gmock.h"
49 #include "testing/gtest/include/gtest/gtest.h" 49 #include "testing/gtest/include/gtest/gtest.h"
50 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" 50 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h"
51 #include "ui/base/l10n/l10n_util.h" 51 #include "ui/base/l10n/l10n_util.h"
52 #include "ui/gfx/rect.h" 52 #include "ui/gfx/rect.h"
53 53
54 typedef PersonalDataManager::GUIDPair GUIDPair;
54 using content::BrowserThread; 55 using content::BrowserThread;
55 using content::WebContents; 56 using content::WebContents;
56 using testing::_; 57 using testing::_;
57 58
58 namespace { 59 namespace {
59 60
60 // The page ID sent to the AutofillManager from the RenderView, used to send 61 // The page ID sent to the AutofillManager from the RenderView, used to send
61 // an IPC message back to the renderer. 62 // an IPC message back to the renderer.
62 const int kDefaultPageID = 137; 63 const int kDefaultPageID = 137;
63 64
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 std::vector<FieldTypeSet> expected_submitted_field_types_; 601 std::vector<FieldTypeSet> expected_submitted_field_types_;
601 std::vector<bool> sent_states_; 602 std::vector<bool> sent_states_;
602 603
603 DISALLOW_COPY_AND_ASSIGN(TestAutofillManager); 604 DISALLOW_COPY_AND_ASSIGN(TestAutofillManager);
604 }; 605 };
605 606
606 } // namespace 607 } // namespace
607 608
608 class AutofillManagerTest : public ChromeRenderViewHostTestHarness { 609 class AutofillManagerTest : public ChromeRenderViewHostTestHarness {
609 public: 610 public:
610 typedef AutofillManager::GUIDPair GUIDPair;
611
612 AutofillManagerTest() 611 AutofillManagerTest()
613 : ChromeRenderViewHostTestHarness(), 612 : ChromeRenderViewHostTestHarness(),
614 ui_thread_(BrowserThread::UI, &message_loop_), 613 ui_thread_(BrowserThread::UI, &message_loop_),
615 file_thread_(BrowserThread::FILE) { 614 file_thread_(BrowserThread::FILE) {
616 } 615 }
617 616
618 virtual ~AutofillManagerTest() { 617 virtual ~AutofillManagerTest() {
619 } 618 }
620 619
621 virtual void SetUp() OVERRIDE { 620 virtual void SetUp() OVERRIDE {
(...skipping 2555 matching lines...) Expand 10 before | Expand all | Expand 10 after
3177 3176
3178 FormData form; 3177 FormData form;
3179 CreateTestAddressFormData(&form); 3178 CreateTestAddressFormData(&form);
3180 std::vector<FormData> forms(1, form); 3179 std::vector<FormData> forms(1, form);
3181 FormsSeen(forms); 3180 FormsSeen(forms);
3182 const FormFieldData& field = form.fields[0]; 3181 const FormFieldData& field = form.fields[0];
3183 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() 3182 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery()
3184 3183
3185 autofill_manager_->SetExternalDelegate(NULL); 3184 autofill_manager_->SetExternalDelegate(NULL);
3186 } 3185 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698