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

Side by Side Diff: base/mac/mac_util_unittest.mm

Issue 632103004: Cleanup: Better constify some strings in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix bad refactoring Created 6 years, 2 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
« no previous file with comments | « base/json/json_reader_unittest.cc ('k') | base/md5_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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
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
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
OLDNEW
« no previous file with comments | « base/json/json_reader_unittest.cc ('k') | base/md5_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698