| 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 "testing/gmock/include/gmock/gmock.h" | 5 #include "testing/gmock/include/gmock/gmock.h" |
| 6 #include "testing/gtest/include/gtest/gtest.h" | 6 #include "testing/gtest/include/gtest/gtest.h" |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/memory/scoped_temp_dir.h" | 10 #include "base/memory/scoped_temp_dir.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/stl_util-inl.h" | 12 #include "base/stl_util-inl.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "content/browser/browser_thread.h" | 15 #include "content/browser/browser_thread.h" |
| 16 #include "chrome/browser/keychain_mock_mac.h" | 16 #include "chrome/browser/keychain_mock_mac.h" |
| 17 #include "chrome/browser/password_manager/password_store_consumer.h" |
| 17 #include "chrome/browser/password_manager/password_store_mac.h" | 18 #include "chrome/browser/password_manager/password_store_mac.h" |
| 18 #include "chrome/browser/password_manager/password_store_mac_internal.h" | 19 #include "chrome/browser/password_manager/password_store_mac_internal.h" |
| 19 #include "chrome/common/chrome_paths.h" | 20 #include "chrome/common/chrome_paths.h" |
| 20 | 21 |
| 21 using webkit_glue::PasswordForm; | 22 using webkit_glue::PasswordForm; |
| 22 using testing::_; | 23 using testing::_; |
| 23 using testing::DoAll; | 24 using testing::DoAll; |
| 24 using testing::WithArg; | 25 using testing::WithArg; |
| 25 | 26 |
| 26 namespace { | 27 namespace { |
| 27 | 28 |
| 28 class MockPasswordStoreConsumer : public PasswordStoreConsumer { | 29 class MockPasswordStoreConsumer : public PasswordStoreConsumer { |
| 29 public: | 30 public: |
| 30 MOCK_METHOD2(OnPasswordStoreRequestDone, | 31 MOCK_METHOD2(OnPasswordStoreRequestDone, |
| 31 void(int, const std::vector<webkit_glue::PasswordForm*>&)); | 32 void(CancelableRequestProvider::Handle, |
| 33 const std::vector<webkit_glue::PasswordForm*>&)); |
| 32 }; | 34 }; |
| 33 | 35 |
| 34 ACTION(STLDeleteElements0) { | 36 ACTION(STLDeleteElements0) { |
| 35 STLDeleteContainerPointers(arg0.begin(), arg0.end()); | 37 STLDeleteContainerPointers(arg0.begin(), arg0.end()); |
| 36 } | 38 } |
| 37 | 39 |
| 38 ACTION(QuitUIMessageLoop) { | 40 ACTION(QuitUIMessageLoop) { |
| 39 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 41 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 40 MessageLoop::current()->Quit(); | 42 MessageLoop::current()->Quit(); |
| 41 } | 43 } |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1015 EXPECT_EQ(0U, matching_items.size()) << "iteration " << i; | 1017 EXPECT_EQ(0U, matching_items.size()) << "iteration " << i; |
| 1016 } | 1018 } |
| 1017 STLDeleteElements(&matching_items); | 1019 STLDeleteElements(&matching_items); |
| 1018 | 1020 |
| 1019 login_db_->GetLogins(*query_form, &matching_items); | 1021 login_db_->GetLogins(*query_form, &matching_items); |
| 1020 EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size()) | 1022 EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size()) |
| 1021 << "iteration " << i; | 1023 << "iteration " << i; |
| 1022 STLDeleteElements(&matching_items); | 1024 STLDeleteElements(&matching_items); |
| 1023 } | 1025 } |
| 1024 } | 1026 } |
| OLD | NEW |