| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 { "/Foo/Bar.app", "/Foo/Bar.app" }, | 85 { "/Foo/Bar.app", "/Foo/Bar.app" }, |
| 86 { "/Foo/Bar.app/", "/Foo/Bar.app" }, | 86 { "/Foo/Bar.app/", "/Foo/Bar.app" }, |
| 87 { "/F/B.app", "/F/B.app" }, | 87 { "/F/B.app", "/F/B.app" }, |
| 88 { "/F/B.app/", "/F/B.app" }, | 88 { "/F/B.app/", "/F/B.app" }, |
| 89 { "/Foo/Bar.app/baz", "/Foo/Bar.app" }, | 89 { "/Foo/Bar.app/baz", "/Foo/Bar.app" }, |
| 90 { "/Foo/Bar.app/baz/", "/Foo/Bar.app" }, | 90 { "/Foo/Bar.app/baz/", "/Foo/Bar.app" }, |
| 91 { "/Foo/Bar.app/baz/quux.app/quuux", "/Foo/Bar.app" }, | 91 { "/Foo/Bar.app/baz/quux.app/quuux", "/Foo/Bar.app" }, |
| 92 { "/Applications/Google Foo.app/bar/Foo Helper.app/quux/Foo Helper", | 92 { "/Applications/Google Foo.app/bar/Foo Helper.app/quux/Foo Helper", |
| 93 "/Applications/Google Foo.app" }, | 93 "/Applications/Google Foo.app" }, |
| 94 }; | 94 }; |
| 95 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(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 TEST_F(MacUtilTest, TestExcludeFileFromBackups) { |
| 104 // The file must already exist in order to set its exclusion property. | 104 // The file must already exist in order to set its exclusion property. |
| 105 ScopedTempDir temp_dir_; | 105 ScopedTempDir temp_dir_; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 279 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 280 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); | 280 FilePath non_existent_path = temp_dir_.path().Append("DummyPath"); |
| 281 ASSERT_FALSE(PathExists(non_existent_path)); | 281 ASSERT_FALSE(PathExists(non_existent_path)); |
| 282 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); | 282 EXPECT_FALSE(RemoveQuarantineAttribute(non_existent_path)); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } // namespace | 285 } // namespace |
| 286 | 286 |
| 287 } // namespace mac | 287 } // namespace mac |
| 288 } // namespace base | 288 } // namespace base |
| OLD | NEW |