| 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 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 905 FilePath db_file = db_dir_.path().AppendASCII("login.db"); | 905 FilePath db_file = db_dir_.path().AppendASCII("login.db"); |
| 906 ASSERT_TRUE(login_db_->Init(db_file)); | 906 ASSERT_TRUE(login_db_->Init(db_file)); |
| 907 | 907 |
| 908 keychain_ = new MockKeychain(); | 908 keychain_ = new MockKeychain(); |
| 909 | 909 |
| 910 store_ = new PasswordStoreMac(keychain_, login_db_); | 910 store_ = new PasswordStoreMac(keychain_, login_db_); |
| 911 ASSERT_TRUE(store_->Init()); | 911 ASSERT_TRUE(store_->Init()); |
| 912 } | 912 } |
| 913 | 913 |
| 914 virtual void TearDown() { | 914 virtual void TearDown() { |
| 915 store_->Shutdown(); | 915 store_->ShutdownOnUIThread(); |
| 916 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 916 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
| 917 MessageLoop::current()->Run(); | 917 MessageLoop::current()->Run(); |
| 918 } | 918 } |
| 919 | 919 |
| 920 protected: | 920 protected: |
| 921 MessageLoopForUI message_loop_; | 921 MessageLoopForUI message_loop_; |
| 922 content::TestBrowserThread ui_thread_; | 922 content::TestBrowserThread ui_thread_; |
| 923 | 923 |
| 924 MockKeychain* keychain_; // Owned by store_. | 924 MockKeychain* keychain_; // Owned by store_. |
| 925 LoginDatabase* login_db_; // Owned by store_. | 925 LoginDatabase* login_db_; // Owned by store_. |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 EXPECT_EQ(0U, matching_items.size()) << "iteration " << i; | 1017 EXPECT_EQ(0U, matching_items.size()) << "iteration " << i; |
| 1018 } | 1018 } |
| 1019 STLDeleteElements(&matching_items); | 1019 STLDeleteElements(&matching_items); |
| 1020 | 1020 |
| 1021 login_db_->GetLogins(*query_form, &matching_items); | 1021 login_db_->GetLogins(*query_form, &matching_items); |
| 1022 EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size()) | 1022 EXPECT_EQ(updates[i].password ? 1U : 0U, matching_items.size()) |
| 1023 << "iteration " << i; | 1023 << "iteration " << i; |
| 1024 STLDeleteElements(&matching_items); | 1024 STLDeleteElements(&matching_items); |
| 1025 } | 1025 } |
| 1026 } | 1026 } |
| OLD | NEW |