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

Side by Side Diff: chrome/browser/media_galleries/media_galleries_test_util.cc

Issue 2692843002: Fail tests fast if overriding the Windows registry fails. (Closed)
Patch Set: sync to position 450085 Created 3 years, 10 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 "chrome/browser/media_galleries/media_galleries_test_util.h" 5 #include "chrome/browser/media_galleries/media_galleries_test_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 // Picasa are installed. 186 // Picasa are installed.
187 app_data_override_.reset(new base::ScopedPathOverride( 187 app_data_override_.reset(new base::ScopedPathOverride(
188 base::DIR_APP_DATA, GetFakeAppDataPath())); 188 base::DIR_APP_DATA, GetFakeAppDataPath()));
189 #endif // OS_WIN || OS_MACOSX 189 #endif // OS_WIN || OS_MACOSX
190 190
191 #if defined(OS_WIN) 191 #if defined(OS_WIN)
192 // Picasa on Windows is by default in the DIR_LOCAL_APP_DATA directory. 192 // Picasa on Windows is by default in the DIR_LOCAL_APP_DATA directory.
193 local_app_data_override_.reset(new base::ScopedPathOverride( 193 local_app_data_override_.reset(new base::ScopedPathOverride(
194 base::DIR_LOCAL_APP_DATA, GetFakeLocalAppDataPath())); 194 base::DIR_LOCAL_APP_DATA, GetFakeLocalAppDataPath()));
195 // Picasa also looks in the registry for an alternate path. 195 // Picasa also looks in the registry for an alternate path.
196 registry_override_.OverrideRegistry(HKEY_CURRENT_USER); 196 ASSERT_NO_FATAL_FAILURE(
197 registry_override_.OverrideRegistry(HKEY_CURRENT_USER));
197 #endif // OS_WIN 198 #endif // OS_WIN
198 199
199 #if defined(OS_MACOSX) 200 #if defined(OS_MACOSX)
200 mac_preferences_.reset(new MockPreferences); 201 mac_preferences_.reset(new MockPreferences);
201 202
202 // iTunes override. 203 // iTunes override.
203 base::FilePath itunes_xml = 204 base::FilePath itunes_xml =
204 GetFakeITunesRootPath().AppendASCII("iTunes Library.xml"); 205 GetFakeITunesRootPath().AppendASCII("iTunes Library.xml");
205 mac_preferences_->AddTestItem( 206 mac_preferences_->AddTestItem(
206 base::mac::NSToCFCast(iapps::kITunesRecentDatabasePathsKey), 207 base::mac::NSToCFCast(iapps::kITunesRecentDatabasePathsKey),
(...skipping 10 matching lines...) Expand all
217 218
218 base::FilePath MakeMediaGalleriesTestingPath(const std::string& dir) { 219 base::FilePath MakeMediaGalleriesTestingPath(const std::string& dir) {
219 #if defined(OS_WIN) 220 #if defined(OS_WIN)
220 return base::FilePath(FILE_PATH_LITERAL("C:\\")).AppendASCII(dir); 221 return base::FilePath(FILE_PATH_LITERAL("C:\\")).AppendASCII(dir);
221 #elif defined(OS_POSIX) 222 #elif defined(OS_POSIX)
222 return base::FilePath(FILE_PATH_LITERAL("/")).Append(dir); 223 return base::FilePath(FILE_PATH_LITERAL("/")).Append(dir);
223 #else 224 #else
224 NOTREACHED(); 225 NOTREACHED();
225 #endif 226 #endif
226 } 227 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698