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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 } | 57 } |
58 | 58 |
59 TEST_F(MacUtilTest, TestGetAppBundlePath) { | 59 TEST_F(MacUtilTest, TestGetAppBundlePath) { |
60 FilePath out; | 60 FilePath out; |
61 | 61 |
62 // Make sure it doesn't crash. | 62 // Make sure it doesn't crash. |
63 out = GetAppBundlePath(FilePath()); | 63 out = GetAppBundlePath(FilePath()); |
64 EXPECT_TRUE(out.empty()); | 64 EXPECT_TRUE(out.empty()); |
65 | 65 |
66 // Some more invalid inputs. | 66 // Some more invalid inputs. |
67 const char* invalid_inputs[] = { | 67 const char* const invalid_inputs[] = { |
68 "/", "/foo", "foo", "/foo/bar.", "foo/bar.", "/foo/bar./bazquux", | 68 "/", "/foo", "foo", "/foo/bar.", "foo/bar.", "/foo/bar./bazquux", |
69 "foo/bar./bazquux", "foo/.app", "//foo", | 69 "foo/bar./bazquux", "foo/.app", "//foo", |
70 }; | 70 }; |
71 for (size_t i = 0; i < arraysize(invalid_inputs); i++) { | 71 for (size_t i = 0; i < arraysize(invalid_inputs); i++) { |
72 out = GetAppBundlePath(FilePath(invalid_inputs[i])); | 72 out = GetAppBundlePath(FilePath(invalid_inputs[i])); |
73 EXPECT_TRUE(out.empty()) << "loop: " << i; | 73 EXPECT_TRUE(out.empty()) << "loop: " << i; |
74 } | 74 } |
75 | 75 |
76 // Some valid inputs; this and |expected_outputs| should be in sync. | 76 // Some valid inputs; this and |expected_outputs| should be in sync. |
77 struct { | 77 struct { |
(...skipping 201 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 |