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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 "/Applications/Google Foo.app" }, | 93 "/Applications/Google Foo.app" }, |
94 }; | 94 }; |
95 for (size_t i = 0; i < arraysize(valid_inputs); i++) { | 95 for (size_t i = 0; i < arraysize(valid_inputs); i++) { |
96 out = GetAppBundlePath(FilePath(valid_inputs[i].in)); | 96 out = GetAppBundlePath(FilePath(valid_inputs[i].in)); |
97 EXPECT_FALSE(out.empty()) << "loop: " << i; | 97 EXPECT_FALSE(out.empty()) << "loop: " << i; |
98 EXPECT_STREQ(valid_inputs[i].expected_out, | 98 EXPECT_STREQ(valid_inputs[i].expected_out, |
99 out.value().c_str()) << "loop: " << i; | 99 out.value().c_str()) << "loop: " << i; |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 TEST_F(MacUtilTest, TestExcludeFileFromBackups) { | 103 // http://crbug.com/425745 |
| 104 TEST_F(MacUtilTest, DISABLED_TestExcludeFileFromBackups) { |
104 // The file must already exist in order to set its exclusion property. | 105 // The file must already exist in order to set its exclusion property. |
105 ScopedTempDir temp_dir_; | 106 ScopedTempDir temp_dir_; |
106 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 107 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
107 FilePath dummy_file_path = temp_dir_.path().Append("DummyFile"); | 108 FilePath dummy_file_path = temp_dir_.path().Append("DummyFile"); |
108 const char dummy_data[] = "All your base are belong to us!"; | 109 const char dummy_data[] = "All your base are belong to us!"; |
109 // Dump something real into the file. | 110 // Dump something real into the file. |
110 ASSERT_EQ(static_cast<int>(arraysize(dummy_data)), | 111 ASSERT_EQ(static_cast<int>(arraysize(dummy_data)), |
111 WriteFile(dummy_file_path, dummy_data, arraysize(dummy_data))); | 112 WriteFile(dummy_file_path, dummy_data, arraysize(dummy_data))); |
112 NSString* fileURLString = | 113 NSString* fileURLString = |
113 [NSString stringWithUTF8String:dummy_file_path.value().c_str()]; | 114 [NSString stringWithUTF8String:dummy_file_path.value().c_str()]; |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 280 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
280 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); | 281 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); |
281 ASSERT_FALSE(PathExists(non_existent_path)); | 282 ASSERT_FALSE(PathExists(non_existent_path)); |
282 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); | 283 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); |
283 } | 284 } |
284 | 285 |
285 } // namespace | 286 } // namespace |
286 | 287 |
287 } // namespace mac | 288 } // namespace mac |
288 } // namespace base | 289 } // namespace base |
OLD | NEW |