Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/password_manager/login_database_unittest.cc

Issue 11359217: Move scoped_temp_dir from base to base/files (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/gtest/include/gtest/gtest.h" 5 #include "testing/gtest/include/gtest/gtest.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/files/scoped_temp_dir.h"
9 #include "base/path_service.h" 10 #include "base/path_service.h"
10 #include "base/scoped_temp_dir.h"
11 #include "base/string_number_conversions.h" 11 #include "base/string_number_conversions.h"
12 #include "base/time.h" 12 #include "base/time.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/password_manager/login_database.h" 14 #include "chrome/browser/password_manager/login_database.h"
15 #include "chrome/common/chrome_paths.h" 15 #include "chrome/common/chrome_paths.h"
16 #include "content/public/common/password_form.h" 16 #include "content/public/common/password_form.h"
17 17
18 using content::PasswordForm; 18 using content::PasswordForm;
19 19
20 class LoginDatabaseTest : public testing::Test { 20 class LoginDatabaseTest : public testing::Test {
21 protected: 21 protected:
22 virtual void SetUp() { 22 virtual void SetUp() {
23 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 23 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
24 file_ = temp_dir_.path().AppendASCII("TestMetadataStoreMacDatabase"); 24 file_ = temp_dir_.path().AppendASCII("TestMetadataStoreMacDatabase");
25 } 25 }
26 26
27 FilePath file_; 27 FilePath file_;
28 ScopedTempDir temp_dir_; 28 base::ScopedTempDir temp_dir_;
29 }; 29 };
30 30
31 TEST_F(LoginDatabaseTest, Logins) { 31 TEST_F(LoginDatabaseTest, Logins) {
32 scoped_ptr<LoginDatabase> db(new LoginDatabase()); 32 scoped_ptr<LoginDatabase> db(new LoginDatabase());
33 33
34 ASSERT_TRUE(db->Init(file_)); 34 ASSERT_TRUE(db->Init(file_));
35 35
36 std::vector<PasswordForm*> result; 36 std::vector<PasswordForm*> result;
37 37
38 // Verify the database is empty. 38 // Verify the database is empty.
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 // GetLogins should give the blacklisted result. 268 // GetLogins should give the blacklisted result.
269 EXPECT_TRUE(db->GetLogins(form, &result)); 269 EXPECT_TRUE(db->GetLogins(form, &result));
270 EXPECT_EQ(1U, result.size()); 270 EXPECT_EQ(1U, result.size());
271 ClearResults(&result); 271 ClearResults(&result);
272 272
273 // So should GetAllBlacklistedLogins. 273 // So should GetAllBlacklistedLogins.
274 EXPECT_TRUE(db->GetBlacklistLogins(&result)); 274 EXPECT_TRUE(db->GetBlacklistLogins(&result));
275 EXPECT_EQ(1U, result.size()); 275 EXPECT_EQ(1U, result.size());
276 ClearResults(&result); 276 ClearResults(&result);
277 } 277 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698