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 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 }; | 759 }; |
760 | 760 |
761 class IncognitoAutofillManagerTest : public AutofillManagerTest { | 761 class IncognitoAutofillManagerTest : public AutofillManagerTest { |
762 public: | 762 public: |
763 IncognitoAutofillManagerTest() {} | 763 IncognitoAutofillManagerTest() {} |
764 virtual ~IncognitoAutofillManagerTest() {} | 764 virtual ~IncognitoAutofillManagerTest() {} |
765 | 765 |
766 virtual TestingProfile* CreateProfile() OVERRIDE { | 766 virtual TestingProfile* CreateProfile() OVERRIDE { |
767 // Create an incognito profile. | 767 // Create an incognito profile. |
768 TestingProfile::Builder builder; | 768 TestingProfile::Builder builder; |
769 builder.SetOffTheRecord(); | 769 scoped_ptr<TestingProfile> profile = builder.Build(); |
770 return builder.Build().release(); | 770 profile->set_incognito(true); |
| 771 return profile.release(); |
771 } | 772 } |
772 }; | 773 }; |
773 | 774 |
774 class TestFormStructure : public FormStructure { | 775 class TestFormStructure : public FormStructure { |
775 public: | 776 public: |
776 explicit TestFormStructure(const FormData& form) : FormStructure(form) {} | 777 explicit TestFormStructure(const FormData& form) : FormStructure(form) {} |
777 virtual ~TestFormStructure() {} | 778 virtual ~TestFormStructure() {} |
778 | 779 |
779 void SetFieldTypes(const std::vector<AutofillFieldType>& heuristic_types, | 780 void SetFieldTypes(const std::vector<AutofillFieldType>& heuristic_types, |
780 const std::vector<AutofillFieldType>& server_types) { | 781 const std::vector<AutofillFieldType>& server_types) { |
(...skipping 2434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3215 | 3216 |
3216 FormData form; | 3217 FormData form; |
3217 CreateTestAddressFormData(&form); | 3218 CreateTestAddressFormData(&form); |
3218 std::vector<FormData> forms(1, form); | 3219 std::vector<FormData> forms(1, form); |
3219 FormsSeen(forms); | 3220 FormsSeen(forms); |
3220 const FormFieldData& field = form.fields[0]; | 3221 const FormFieldData& field = form.fields[0]; |
3221 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() | 3222 GetAutofillSuggestions(form, field); // should call the delegate's OnQuery() |
3222 | 3223 |
3223 autofill_manager_->SetExternalDelegate(NULL); | 3224 autofill_manager_->SetExternalDelegate(NULL); |
3224 } | 3225 } |
OLD | NEW |