| 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/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 908 ASSERT_TRUE(login_db_->Init(db_file)); | 908 ASSERT_TRUE(login_db_->Init(db_file)); |
| 909 | 909 |
| 910 keychain_ = new MockKeychain(3); | 910 keychain_ = new MockKeychain(3); |
| 911 | 911 |
| 912 store_ = new PasswordStoreMac(keychain_, login_db_); | 912 store_ = new PasswordStoreMac(keychain_, login_db_); |
| 913 ASSERT_TRUE(store_->Init()); | 913 ASSERT_TRUE(store_->Init()); |
| 914 } | 914 } |
| 915 | 915 |
| 916 virtual void TearDown() { | 916 virtual void TearDown() { |
| 917 store_->Shutdown(); | 917 store_->Shutdown(); |
| 918 MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask); | 918 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure); |
| 919 MessageLoop::current()->Run(); | 919 MessageLoop::current()->Run(); |
| 920 } | 920 } |
| 921 | 921 |
| 922 protected: | 922 protected: |
| 923 MessageLoopForUI message_loop_; | 923 MessageLoopForUI message_loop_; |
| 924 content::TestBrowserThread ui_thread_; | 924 content::TestBrowserThread ui_thread_; |
| 925 | 925 |
| 926 MockKeychain* keychain_; // Owned by store_. | 926 MockKeychain* keychain_; // Owned by store_. |
| 927 LoginDatabase* login_db_; // Owned by store_. | 927 LoginDatabase* login_db_; // Owned by store_. |
| 928 scoped_refptr<PasswordStoreMac> store_; | 928 scoped_refptr<PasswordStoreMac> store_; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1019 EXPECT_EQ(0U, matching_items.size()) << "iteration " << i; | 1019 EXPECT_EQ(0U, matching_items.size()) << "iteration " << i; |
| 1020 } | 1020 } |
| 1021 STLDeleteElements(&matching_items); | 1021 STLDeleteElements(&matching_items); |
| 1022 | 1022 |
| 1023 login_db_->GetLogins(*query_form, &matching_items); | 1023 login_db_->GetLogins(*query_form, &matching_items); |
| 1024 EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size()) | 1024 EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size()) |
| 1025 << "iteration " << i; | 1025 << "iteration " << i; |
| 1026 STLDeleteElements(&matching_items); | 1026 STLDeleteElements(&matching_items); |
| 1027 } | 1027 } |
| 1028 } | 1028 } |
| OLD | NEW |