| 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/basictypes.h" | 5 #include "base/basictypes.h" |
| 6 #include "base/bind.h" | 6 #include "base/bind.h" |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
| 9 #include "base/synchronization/waitable_event.h" | 9 #include "base/synchronization/waitable_event.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
| 12 #include "chrome/browser/password_manager/password_form_data.h" | 12 #include "chrome/browser/password_manager/password_form_data.h" |
| 13 #include "chrome/browser/password_manager/password_store_consumer.h" | 13 #include "chrome/browser/password_manager/password_store_consumer.h" |
| 14 #include "chrome/browser/password_manager/password_store_default.h" | 14 #include "chrome/browser/password_manager/password_store_default.h" |
| 15 #include "chrome/test/base/testing_profile.h" | 15 #include "chrome/test/base/testing_profile.h" |
| 16 #include "content/public/browser/notification_details.h" | 16 #include "content/public/browser/notification_details.h" |
| 17 #include "content/public/browser/notification_registrar.h" | 17 #include "content/public/browser/notification_registrar.h" |
| 18 #include "content/public/browser/notification_source.h" | 18 #include "content/public/browser/notification_source.h" |
| 19 #include "content/public/test/mock_notification_observer.h" | 19 #include "content/public/test/mock_notification_observer.h" |
| 20 #include "content/public/test/test_browser_thread.h" | 20 #include "content/public/test/test_browser_thread.h" |
| 21 #include "testing/gmock/include/gmock/gmock.h" | 21 #include "testing/gmock/include/gmock/gmock.h" |
| 22 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 23 | 23 |
| 24 using autofill::PasswordForm; |
| 24 using base::WaitableEvent; | 25 using base::WaitableEvent; |
| 25 using content::BrowserThread; | 26 using content::BrowserThread; |
| 26 using testing::_; | 27 using testing::_; |
| 27 using testing::DoAll; | 28 using testing::DoAll; |
| 28 using testing::WithArg; | 29 using testing::WithArg; |
| 29 using content::PasswordForm; | |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 class MockPasswordStoreConsumer : public PasswordStoreConsumer { | 33 class MockPasswordStoreConsumer : public PasswordStoreConsumer { |
| 34 public: | 34 public: |
| 35 MOCK_METHOD2(OnPasswordStoreRequestDone, | 35 MOCK_METHOD2(OnPasswordStoreRequestDone, |
| 36 void(CancelableRequestProvider::Handle, | 36 void(CancelableRequestProvider::Handle, |
| 37 const std::vector<PasswordForm*>&)); | 37 const std::vector<PasswordForm*>&)); |
| 38 MOCK_METHOD1(OnGetPasswordStoreResults, | 38 MOCK_METHOD1(OnGetPasswordStoreResults, |
| 39 void(const std::vector<PasswordForm*>&)); | 39 void(const std::vector<PasswordForm*>&)); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 .WillOnce(WithArg<0>(STLDeleteElements0())).RetiresOnSaturation(); | 260 .WillOnce(WithArg<0>(STLDeleteElements0())).RetiresOnSaturation(); |
| 261 | 261 |
| 262 store->GetLogins(www_google, &consumer); | 262 store->GetLogins(www_google, &consumer); |
| 263 store->GetLogins(accounts_google, &consumer); | 263 store->GetLogins(accounts_google, &consumer); |
| 264 store->GetLogins(bar_example, &consumer); | 264 store->GetLogins(bar_example, &consumer); |
| 265 | 265 |
| 266 base::MessageLoop::current()->Run(); | 266 base::MessageLoop::current()->Run(); |
| 267 | 267 |
| 268 STLDeleteElements(&all_forms); | 268 STLDeleteElements(&all_forms); |
| 269 } | 269 } |
| OLD | NEW |