| 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 "base/memory/scoped_ptr.h" | 5 #include "base/memory/scoped_ptr.h" |
| 6 #include "base/message_loop/message_loop.h" | 6 #include "base/message_loop/message_loop.h" |
| 7 #include "base/prefs/pref_registry_simple.h" | 7 #include "base/prefs/pref_registry_simple.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/prefs/testing_pref_service.h" | 9 #include "base/prefs/testing_pref_service.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 saved_match_.origin = GURL("http://accounts.google.com/a/ServiceLoginAuth"); | 134 saved_match_.origin = GURL("http://accounts.google.com/a/ServiceLoginAuth"); |
| 135 saved_match_.action = GURL("http://accounts.google.com/a/ServiceLogin"); | 135 saved_match_.action = GURL("http://accounts.google.com/a/ServiceLogin"); |
| 136 saved_match_.preferred = true; | 136 saved_match_.preferred = true; |
| 137 saved_match_.username_value = ASCIIToUTF16("test@gmail.com"); | 137 saved_match_.username_value = ASCIIToUTF16("test@gmail.com"); |
| 138 saved_match_.password_value = ASCIIToUTF16("test1"); | 138 saved_match_.password_value = ASCIIToUTF16("test1"); |
| 139 saved_match_.other_possible_usernames.push_back( | 139 saved_match_.other_possible_usernames.push_back( |
| 140 ASCIIToUTF16("test2@gmail.com")); | 140 ASCIIToUTF16("test2@gmail.com")); |
| 141 } | 141 } |
| 142 | 142 |
| 143 virtual void TearDown() { | 143 virtual void TearDown() { |
| 144 if (mock_store_) | 144 if (mock_store_.get()) |
| 145 mock_store_->Shutdown(); | 145 mock_store_->Shutdown(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void InitializeMockStore() { | 148 void InitializeMockStore() { |
| 149 if (!mock_store_) { | 149 if (!mock_store_.get()) { |
| 150 mock_store_ = new MockPasswordStore(); | 150 mock_store_ = new MockPasswordStore(); |
| 151 ASSERT_TRUE(mock_store_); | 151 ASSERT_TRUE(mock_store_.get()); |
| 152 } | 152 } |
| 153 } | 153 } |
| 154 | 154 |
| 155 MockPasswordStore* mock_store() const { return mock_store_.get(); } | 155 MockPasswordStore* mock_store() const { return mock_store_.get(); } |
| 156 | 156 |
| 157 PasswordForm* GetPendingCredentials(PasswordFormManager* p) { | 157 PasswordForm* GetPendingCredentials(PasswordFormManager* p) { |
| 158 return &p->pending_credentials_; | 158 return &p->pending_credentials_; |
| 159 } | 159 } |
| 160 | 160 |
| 161 void SimulateMatchingPhase(PasswordFormManager* p, | 161 void SimulateMatchingPhase(PasswordFormManager* p, |
| (...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1082 PasswordStore::ALLOW_PROMPT); | 1082 PasswordStore::ALLOW_PROMPT); |
| 1083 RunAllPendingTasks(); | 1083 RunAllPendingTasks(); |
| 1084 | 1084 |
| 1085 // Make sure that the preferred match is updated appropriately. | 1085 // Make sure that the preferred match is updated appropriately. |
| 1086 EXPECT_EQ(ASCIIToUTF16("third"), | 1086 EXPECT_EQ(ASCIIToUTF16("third"), |
| 1087 retrieving_manager.preferred_match()->password_value); | 1087 retrieving_manager.preferred_match()->password_value); |
| 1088 password_store->Shutdown(); | 1088 password_store->Shutdown(); |
| 1089 } | 1089 } |
| 1090 | 1090 |
| 1091 } // namespace password_manager | 1091 } // namespace password_manager |
| OLD | NEW |