OLD | NEW |
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/files/scoped_temp_dir.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.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 "components/autofill/core/common/password_form.h" |
17 #include "testing/gmock/include/gmock/gmock.h" | 17 #include "testing/gmock/include/gmock/gmock.h" |
18 | 18 |
19 using content::PasswordForm; | 19 using autofill::PasswordForm; |
20 | 20 |
21 using ::testing::Eq; | 21 using ::testing::Eq; |
22 | 22 |
23 class LoginDatabaseTest : public testing::Test { | 23 class LoginDatabaseTest : public testing::Test { |
24 protected: | 24 protected: |
25 virtual void SetUp() { | 25 virtual void SetUp() { |
26 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 26 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
27 file_ = temp_dir_.path().AppendASCII("TestMetadataStoreMacDatabase"); | 27 file_ = temp_dir_.path().AppendASCII("TestMetadataStoreMacDatabase"); |
28 | 28 |
29 ASSERT_TRUE(db_.Init(file_)); | 29 ASSERT_TRUE(db_.Init(file_)); |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 // | 621 // |
622 // Only POSIX because GetPosixFilePermissions() only exists on POSIX. | 622 // Only POSIX because GetPosixFilePermissions() only exists on POSIX. |
623 // This tests that sql::Connection::set_restrict_to_user() was called, | 623 // This tests that sql::Connection::set_restrict_to_user() was called, |
624 // and that function is a noop on non-POSIX platforms in any case. | 624 // and that function is a noop on non-POSIX platforms in any case. |
625 TEST_F(LoginDatabaseTest, FilePermissions) { | 625 TEST_F(LoginDatabaseTest, FilePermissions) { |
626 int mode = file_util::FILE_PERMISSION_MASK; | 626 int mode = file_util::FILE_PERMISSION_MASK; |
627 EXPECT_TRUE(file_util::GetPosixFilePermissions(file_, &mode)); | 627 EXPECT_TRUE(file_util::GetPosixFilePermissions(file_, &mode)); |
628 EXPECT_EQ((mode & file_util::FILE_PERMISSION_USER_MASK), mode); | 628 EXPECT_EQ((mode & file_util::FILE_PERMISSION_USER_MASK), mode); |
629 } | 629 } |
630 #endif // defined(OS_POSIX) | 630 #endif // defined(OS_POSIX) |
OLD | NEW |