| 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 <errno.h> | 5 #include <errno.h> |
| 6 #include <sys/types.h> | 6 #include <sys/types.h> |
| 7 #include <sys/xattr.h> | 7 #include <sys/xattr.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 const GURL& referrer_url() const { | 44 const GURL& referrer_url() const { |
| 45 return referrer_url_; | 45 return referrer_url_; |
| 46 } | 46 } |
| 47 | 47 |
| 48 bool is_xattr_supported() const { | 48 bool is_xattr_supported() const { |
| 49 return is_xattr_supported_; | 49 return is_xattr_supported_; |
| 50 } | 50 } |
| 51 | 51 |
| 52 protected: | 52 protected: |
| 53 virtual void SetUp() OVERRIDE { | 53 virtual void SetUp() override { |
| 54 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 54 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 55 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &test_file_)); | 55 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &test_file_)); |
| 56 int result = setxattr(test_file_.value().c_str(), | 56 int result = setxattr(test_file_.value().c_str(), |
| 57 "user.test", "test", 4, 0); | 57 "user.test", "test", 4, 0); |
| 58 is_xattr_supported_ = (!result) || (errno != ENOTSUP); | 58 is_xattr_supported_ = (!result) || (errno != ENOTSUP); |
| 59 if (!is_xattr_supported_) { | 59 if (!is_xattr_supported_) { |
| 60 VLOG(0) << "Test will be skipped because extended attributes are not " | 60 VLOG(0) << "Test will be skipped because extended attributes are not " |
| 61 << "supported on this OS/file system."; | 61 << "supported on this OS/file system."; |
| 62 } | 62 } |
| 63 } | 63 } |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 AddOriginMetadataToFile(test_file(), invalid_url, invalid_url); | 154 AddOriginMetadataToFile(test_file(), invalid_url, invalid_url); |
| 155 GetExtendedAttributeNames(&attr_names); | 155 GetExtendedAttributeNames(&attr_names); |
| 156 EXPECT_EQ(attr_names.end(), find(attr_names.begin(), attr_names.end(), | 156 EXPECT_EQ(attr_names.end(), find(attr_names.begin(), attr_names.end(), |
| 157 kSourceURLAttrName)); | 157 kSourceURLAttrName)); |
| 158 EXPECT_EQ(attr_names.end(), find(attr_names.begin(), attr_names.end(), | 158 EXPECT_EQ(attr_names.end(), find(attr_names.begin(), attr_names.end(), |
| 159 kReferrerURLAttrName)); | 159 kReferrerURLAttrName)); |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace | 162 } // namespace |
| 163 } // namespace content | 163 } // namespace content |
| OLD | NEW |