| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <string> | 6 #include <string> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 #include "testing/gtest/include/gtest/gtest.h" | 39 #include "testing/gtest/include/gtest/gtest.h" |
| 40 | 40 |
| 41 using base::ASCIIToUTF16; | 41 using base::ASCIIToUTF16; |
| 42 using base::UTF8ToUTF16; | 42 using base::UTF8ToUTF16; |
| 43 | 43 |
| 44 namespace autofill { | 44 namespace autofill { |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| 47 enum UserMode { USER_MODE_NORMAL, USER_MODE_INCOGNITO }; | 47 enum UserMode { USER_MODE_NORMAL, USER_MODE_INCOGNITO }; |
| 48 | 48 |
| 49 ACTION(QuitMainMessageLoop) { base::MessageLoop::current()->Quit(); } | 49 ACTION(QuitMainMessageLoop) { |
| 50 base::MessageLoop::current()->QuitWhenIdle(); |
| 51 } |
| 50 | 52 |
| 51 class PersonalDataLoadedObserverMock : public PersonalDataManagerObserver { | 53 class PersonalDataLoadedObserverMock : public PersonalDataManagerObserver { |
| 52 public: | 54 public: |
| 53 PersonalDataLoadedObserverMock() {} | 55 PersonalDataLoadedObserverMock() {} |
| 54 virtual ~PersonalDataLoadedObserverMock() {} | 56 virtual ~PersonalDataLoadedObserverMock() {} |
| 55 | 57 |
| 56 MOCK_METHOD0(OnPersonalDataChanged, void()); | 58 MOCK_METHOD0(OnPersonalDataChanged, void()); |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 template <typename T> | 61 template <typename T> |
| (...skipping 3374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3434 suggestions = personal_data_->GetProfileSuggestions( | 3436 suggestions = personal_data_->GetProfileSuggestions( |
| 3435 AutofillType(NAME_FIRST), base::ASCIIToUTF16("Ma"), false, | 3437 AutofillType(NAME_FIRST), base::ASCIIToUTF16("Ma"), false, |
| 3436 std::vector<ServerFieldType>()); | 3438 std::vector<ServerFieldType>()); |
| 3437 ASSERT_EQ(3, static_cast<int>(suggestions.size())); | 3439 ASSERT_EQ(3, static_cast<int>(suggestions.size())); |
| 3438 EXPECT_EQ(suggestions[0].value, base::ASCIIToUTF16("Marion2_1")); | 3440 EXPECT_EQ(suggestions[0].value, base::ASCIIToUTF16("Marion2_1")); |
| 3439 EXPECT_EQ(suggestions[1].value, base::ASCIIToUTF16("Marion1_2")); | 3441 EXPECT_EQ(suggestions[1].value, base::ASCIIToUTF16("Marion1_2")); |
| 3440 EXPECT_EQ(suggestions[2].value, base::ASCIIToUTF16("Marion3_3")); | 3442 EXPECT_EQ(suggestions[2].value, base::ASCIIToUTF16("Marion3_3")); |
| 3441 } | 3443 } |
| 3442 | 3444 |
| 3443 } // namespace autofill | 3445 } // namespace autofill |
| OLD | NEW |