| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <wincrypt.h> | 6 #include <wincrypt.h> |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/memory/scoped_temp_dir.h" | 11 #include "base/memory/scoped_temp_dir.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/stl_util-inl.h" | 13 #include "base/stl_util-inl.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "base/synchronization/waitable_event.h" | 15 #include "base/synchronization/waitable_event.h" |
| 16 #include "chrome/browser/password_manager/password_form_data.h" | 16 #include "chrome/browser/password_manager/password_form_data.h" |
| 17 #include "chrome/browser/password_manager/password_store_consumer.h" |
| 17 #include "chrome/browser/password_manager/password_store_win.h" | 18 #include "chrome/browser/password_manager/password_store_win.h" |
| 18 #include "chrome/browser/password_manager/ie7_password.h" | 19 #include "chrome/browser/password_manager/ie7_password.h" |
| 19 #include "chrome/browser/prefs/pref_service.h" | 20 #include "chrome/browser/prefs/pref_service.h" |
| 20 #include "chrome/common/pref_names.h" | 21 #include "chrome/common/pref_names.h" |
| 21 #include "chrome/test/signaling_task.h" | 22 #include "chrome/test/signaling_task.h" |
| 22 #include "chrome/test/testing_profile.h" | 23 #include "chrome/test/testing_profile.h" |
| 23 #include "content/browser/browser_thread.h" | 24 #include "content/browser/browser_thread.h" |
| 24 #include "testing/gmock/include/gmock/gmock.h" | 25 #include "testing/gmock/include/gmock/gmock.h" |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 26 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 27 |
| 27 using base::WaitableEvent; | 28 using base::WaitableEvent; |
| 28 using testing::_; | 29 using testing::_; |
| 29 using testing::DoAll; | 30 using testing::DoAll; |
| 30 using testing::WithArg; | 31 using testing::WithArg; |
| 31 using webkit_glue::PasswordForm; | 32 using webkit_glue::PasswordForm; |
| 32 | 33 |
| 33 namespace { | 34 namespace { |
| 34 | 35 |
| 35 class MockPasswordStoreConsumer : public PasswordStoreConsumer { | 36 class MockPasswordStoreConsumer : public PasswordStoreConsumer { |
| 36 public: | 37 public: |
| 37 MOCK_METHOD2(OnPasswordStoreRequestDone, | 38 MOCK_METHOD2(OnPasswordStoreRequestDone, |
| 38 void(int, const std::vector<webkit_glue::PasswordForm*>&)); | 39 void(CancelableRequestProvider::Handle, |
| 40 const std::vector<webkit_glue::PasswordForm*>&)); |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 class MockWebDataServiceConsumer : public WebDataServiceConsumer { | 43 class MockWebDataServiceConsumer : public WebDataServiceConsumer { |
| 42 public: | 44 public: |
| 43 MOCK_METHOD2(OnWebDataServiceRequestDone, | 45 MOCK_METHOD2(OnWebDataServiceRequestDone, |
| 44 void(WebDataService::Handle, const WDTypedResult*)); | 46 void(WebDataService::Handle, const WDTypedResult*)); |
| 45 }; | 47 }; |
| 46 | 48 |
| 47 } // anonymous namespace | 49 } // anonymous namespace |
| 48 | 50 |
| (...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, | 498 BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, |
| 497 new SignalingTask(&done)); | 499 new SignalingTask(&done)); |
| 498 done.Wait(); | 500 done.Wait(); |
| 499 | 501 |
| 500 // Handle the callback from the WDS. | 502 // Handle the callback from the WDS. |
| 501 MessageLoop::current()->RunAllPending(); | 503 MessageLoop::current()->RunAllPending(); |
| 502 | 504 |
| 503 STLDeleteElements(&expected_autofillable); | 505 STLDeleteElements(&expected_autofillable); |
| 504 STLDeleteElements(&expected_blacklisted); | 506 STLDeleteElements(&expected_blacklisted); |
| 505 } | 507 } |
| OLD | NEW |