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

Side by Side Diff: chrome/browser/ui/webui/bidi_checker_web_ui_test.cc

Issue 834183005: Move two locale functions from rtl.h into l10n_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/ui/webui/bidi_checker_web_ui_test.h" 5 #include "chrome/browser/ui/webui/bidi_checker_web_ui_test.h"
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 #include "base/i18n/rtl.h" 8 #include "base/i18n/rtl.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/synchronization/waitable_event.h" 13 #include "base/synchronization/waitable_event.h"
14 #include "base/threading/platform_thread.h" 14 #include "base/threading/platform_thread.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "base/values.h" 16 #include "base/values.h"
17 #include "chrome/browser/autofill/personal_data_manager_factory.h" 17 #include "chrome/browser/autofill/personal_data_manager_factory.h"
18 #include "chrome/browser/history/history_service.h" 18 #include "chrome/browser/history/history_service.h"
19 #include "chrome/browser/history/history_service_factory.h" 19 #include "chrome/browser/history/history_service_factory.h"
20 #include "chrome/browser/prefs/session_startup_pref.h" 20 #include "chrome/browser/prefs/session_startup_pref.h"
21 #include "chrome/browser/profiles/profile.h" 21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
23 #include "chrome/common/url_constants.h" 23 #include "chrome/common/url_constants.h"
24 #include "chrome/test/base/ui_test_utils.h" 24 #include "chrome/test/base/ui_test_utils.h"
25 #include "components/autofill/core/browser/autofill_profile.h" 25 #include "components/autofill/core/browser/autofill_profile.h"
26 #include "components/autofill/core/browser/autofill_test_utils.h" 26 #include "components/autofill/core/browser/autofill_test_utils.h"
27 #include "components/autofill/core/browser/personal_data_manager.h" 27 #include "components/autofill/core/browser/personal_data_manager.h"
28 #include "content/public/browser/browser_thread.h" 28 #include "content/public/browser/browser_thread.h"
29 #include "ui/base/l10n/l10n_util.h"
29 #include "ui/base/resource/resource_bundle.h" 30 #include "ui/base/resource/resource_bundle.h"
30 31
31 using autofill::AutofillProfile; 32 using autofill::AutofillProfile;
32 using autofill::PersonalDataManager; 33 using autofill::PersonalDataManager;
33 34
34 static const base::FilePath::CharType* kWebUIBidiCheckerLibraryJS = 35 static const base::FilePath::CharType* kWebUIBidiCheckerLibraryJS =
35 FILE_PATH_LITERAL("third_party/bidichecker/bidichecker_packaged.js"); 36 FILE_PATH_LITERAL("third_party/bidichecker/bidichecker_packaged.js");
36 37
37 namespace { 38 namespace {
38 base::FilePath WebUIBidiCheckerLibraryJSPath() { 39 base::FilePath WebUIBidiCheckerLibraryJSPath() {
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } 113 }
113 114
114 void WebUIBidiCheckerBrowserTestRTL::RunBidiCheckerOnPage( 115 void WebUIBidiCheckerBrowserTestRTL::RunBidiCheckerOnPage(
115 const std::string& page_url) { 116 const std::string& page_url) {
116 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(page_url, true); 117 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(page_url, true);
117 } 118 }
118 119
119 void WebUIBidiCheckerBrowserTestRTL::SetUpOnMainThread() { 120 void WebUIBidiCheckerBrowserTestRTL::SetUpOnMainThread() {
120 WebUIBidiCheckerBrowserTest::SetUpOnMainThread(); 121 WebUIBidiCheckerBrowserTest::SetUpOnMainThread();
121 base::FilePath pak_path; 122 base::FilePath pak_path;
122 app_locale_ = base::i18n::GetConfiguredLocale(); 123 app_locale_ = l10n_util::GetConfiguredLocale();
123 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path)); 124 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path));
124 pak_path = pak_path.DirName(); 125 pak_path = pak_path.DirName();
125 pak_path = pak_path.AppendASCII("pseudo_locales"); 126 pak_path = pak_path.AppendASCII("pseudo_locales");
126 pak_path = pak_path.AppendASCII("fake-bidi"); 127 pak_path = pak_path.AppendASCII("fake-bidi");
127 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak")); 128 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak"));
128 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path); 129 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path);
129 ReloadLocaleResources("he"); 130 ReloadLocaleResources("he");
130 base::i18n::SetICUDefaultLocale("he"); 131 base::i18n::SetICUDefaultLocale("he");
131 } 132 }
132 133
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 // chrome://history-frame 722 // chrome://history-frame
722 //============================== 723 //==============================
723 724
724 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestHistoryFrame) { 725 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestHistoryFrame) {
725 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); 726 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL);
726 } 727 }
727 728
728 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHistoryFrame) { 729 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHistoryFrame) {
729 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); 730 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL);
730 } 731 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698