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

Side by Side Diff: chrome/common/extensions/extension_l10n_util.cc

Issue 10837130: Set locale for extension tests, keep it from affecting global state (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « chrome/common/extensions/extension_l10n_util.h ('k') | no next file » | 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 #include "chrome/common/extensions/extension_l10n_util.h" 5 #include "chrome/common/extensions/extension_l10n_util.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 347
348 if (std::find(subdir.begin(), subdir.end(), '.') != subdir.end()) 348 if (std::find(subdir.begin(), subdir.end(), '.') != subdir.end())
349 return true; 349 return true;
350 350
351 if (all_locales.find(subdir) == all_locales.end()) 351 if (all_locales.find(subdir) == all_locales.end())
352 return true; 352 return true;
353 353
354 return false; 354 return false;
355 } 355 }
356 356
357 ScopedLocaleForTest::ScopedLocaleForTest()
358 : locale_(extension_l10n_util::CurrentLocaleOrDefault()) {}
359
360 ScopedLocaleForTest::ScopedLocaleForTest(const std::string& locale)
361 : locale_(extension_l10n_util::CurrentLocaleOrDefault()) {
362 extension_l10n_util::SetProcessLocale(locale);
363 }
364
365 ScopedLocaleForTest::~ScopedLocaleForTest() {
366 extension_l10n_util::SetProcessLocale(locale_);
367 }
368
357 } // namespace extension_l10n_util 369 } // namespace extension_l10n_util
OLDNEW
« no previous file with comments | « chrome/common/extensions/extension_l10n_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698