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

Side by Side Diff: content/browser/download/file_metadata_unittest_linux.cc

Issue 12213066: Use base namespace for FilePath in content/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months 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 <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 14 matching lines...) Expand all
25 using std::istringstream; 25 using std::istringstream;
26 using std::string; 26 using std::string;
27 using std::vector; 27 using std::vector;
28 28
29 class FileMetadataLinuxTest : public testing::Test { 29 class FileMetadataLinuxTest : public testing::Test {
30 public: 30 public:
31 FileMetadataLinuxTest() 31 FileMetadataLinuxTest()
32 : source_url_("http://www.source.com"), 32 : source_url_("http://www.source.com"),
33 referrer_url_("http://www.referrer.com") {} 33 referrer_url_("http://www.referrer.com") {}
34 34
35 const FilePath& test_file() const { 35 const base::FilePath& test_file() const {
36 return test_file_; 36 return test_file_;
37 } 37 }
38 38
39 const GURL& source_url() const { 39 const GURL& source_url() const {
40 return source_url_; 40 return source_url_;
41 } 41 }
42 42
43 const GURL& referrer_url() const { 43 const GURL& referrer_url() const {
44 return referrer_url_; 44 return referrer_url_;
45 } 45 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 pos = find(attr_names.begin(), attr_names.end(), kReferrerURLAttrName); 98 pos = find(attr_names.begin(), attr_names.end(), kReferrerURLAttrName);
99 EXPECT_NE(pos, attr_names.end()); 99 EXPECT_NE(pos, attr_names.end());
100 100
101 // Check if the attribute values are set correctly 101 // Check if the attribute values are set correctly
102 CheckExtendedAttributeValue(kSourceURLAttrName, source_url().spec()); 102 CheckExtendedAttributeValue(kSourceURLAttrName, source_url().spec());
103 CheckExtendedAttributeValue(kReferrerURLAttrName, referrer_url().spec()); 103 CheckExtendedAttributeValue(kReferrerURLAttrName, referrer_url().spec());
104 } 104 }
105 105
106 private: 106 private:
107 base::ScopedTempDir temp_dir_; 107 base::ScopedTempDir temp_dir_;
108 FilePath test_file_; 108 base::FilePath test_file_;
109 GURL source_url_; 109 GURL source_url_;
110 GURL referrer_url_; 110 GURL referrer_url_;
111 bool is_xattr_supported_; 111 bool is_xattr_supported_;
112 }; 112 };
113 113
114 TEST_F(FileMetadataLinuxTest, CheckMetadataSetCorrectly) { 114 TEST_F(FileMetadataLinuxTest, CheckMetadataSetCorrectly) {
115 if (!is_xattr_supported()) return; 115 if (!is_xattr_supported()) return;
116 AddOriginMetadataToFile(test_file(), source_url(), referrer_url()); 116 AddOriginMetadataToFile(test_file(), source_url(), referrer_url());
117 VerifyAttributesAreSetCorrectly(); 117 VerifyAttributesAreSetCorrectly();
118 } 118 }
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « content/browser/download/file_metadata_mac.mm ('k') | content/browser/download/mhtml_generation_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698