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

Side by Side Diff: base/path_service_unittest.cc

Issue 2909943003: Removing useless Win7 checks + standardize its use (Closed)
Patch Set: Fix reversed conditionnal Created 3 years, 6 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
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 "base/path_service.h" 5 #include "base/path_service.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 24 matching lines...) Expand all
35 // exist. 35 // exist.
36 if (dir_type == DIR_CACHE) 36 if (dir_type == DIR_CACHE)
37 check_path_exists = false; 37 check_path_exists = false;
38 #endif 38 #endif
39 #if defined(OS_LINUX) 39 #if defined(OS_LINUX)
40 // On the linux try-bots: a path is returned (e.g. /home/chrome-bot/Desktop), 40 // On the linux try-bots: a path is returned (e.g. /home/chrome-bot/Desktop),
41 // but it doesn't exist. 41 // but it doesn't exist.
42 if (dir_type == DIR_USER_DESKTOP) 42 if (dir_type == DIR_USER_DESKTOP)
43 check_path_exists = false; 43 check_path_exists = false;
44 #endif 44 #endif
45 #if defined(OS_WIN)
46 if (dir_type == DIR_TASKBAR_PINS) {
47 // There is no pinned-to-taskbar shortcuts prior to Win7.
48 if (base::win::GetVersion() < base::win::VERSION_WIN7)
49 check_path_exists = false;
50 }
51 #endif
52 #if defined(OS_MACOSX) 45 #if defined(OS_MACOSX)
53 if (dir_type != DIR_EXE && dir_type != DIR_MODULE && 46 if (dir_type != DIR_EXE && dir_type != DIR_MODULE &&
54 dir_type != FILE_EXE && dir_type != FILE_MODULE) { 47 dir_type != FILE_EXE && dir_type != FILE_MODULE) {
55 if (path.ReferencesParent()) 48 if (path.ReferencesParent())
56 return false; 49 return false;
57 } 50 }
58 #else 51 #else
59 if (path.ReferencesParent()) 52 if (path.ReferencesParent())
60 return false; 53 return false;
61 #endif 54 #endif
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 EXPECT_TRUE(PathService::Get(DIR_PROGRAM_FILES6432, 260 EXPECT_TRUE(PathService::Get(DIR_PROGRAM_FILES6432,
268 &programfiles_dir)); 261 &programfiles_dir));
269 EXPECT_EQ(programfiles_dir.value(), 262 EXPECT_EQ(programfiles_dir.value(),
270 FILE_PATH_LITERAL("C:\\Program Files")); 263 FILE_PATH_LITERAL("C:\\Program Files"));
271 } 264 }
272 #endif 265 #endif
273 } 266 }
274 #endif 267 #endif
275 268
276 } // namespace base 269 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698