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