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" |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 EXPECT_THAT(output, Eq(vec)); | 630 EXPECT_THAT(output, Eq(vec)); |
631 } | 631 } |
632 | 632 |
633 #if defined(OS_POSIX) | 633 #if defined(OS_POSIX) |
634 // Only the current user has permission to read the database. | 634 // Only the current user has permission to read the database. |
635 // | 635 // |
636 // Only POSIX because GetPosixFilePermissions() only exists on POSIX. | 636 // Only POSIX because GetPosixFilePermissions() only exists on POSIX. |
637 // This tests that sql::Connection::set_restrict_to_user() was called, | 637 // This tests that sql::Connection::set_restrict_to_user() was called, |
638 // and that function is a noop on non-POSIX platforms in any case. | 638 // and that function is a noop on non-POSIX platforms in any case. |
639 TEST_F(LoginDatabaseTest, FilePermissions) { | 639 TEST_F(LoginDatabaseTest, FilePermissions) { |
640 int mode = file_util::FILE_PERMISSION_MASK; | 640 int mode = base::FILE_PERMISSION_MASK; |
641 EXPECT_TRUE(file_util::GetPosixFilePermissions(file_, &mode)); | 641 EXPECT_TRUE(base::GetPosixFilePermissions(file_, &mode)); |
642 EXPECT_EQ((mode & file_util::FILE_PERMISSION_USER_MASK), mode); | 642 EXPECT_EQ((mode & base::FILE_PERMISSION_USER_MASK), mode); |
643 } | 643 } |
644 #endif // defined(OS_POSIX) | 644 #endif // defined(OS_POSIX) |
OLD | NEW |