OLD | NEW |
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 Loading... |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |