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

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

Issue 8606009: Revert 110861 - Adding more bidichecker tests and doing some minor cleanups. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/path_service.h" 9 #include "base/path_service.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/browser/autofill/autofill_common_test.h" 12 #include "chrome/browser/autofill/autofill_common_test.h"
13 #include "chrome/browser/autofill/autofill_profile.h" 13 #include "chrome/browser/autofill/autofill_profile.h"
14 #include "chrome/browser/autofill/personal_data_manager.h" 14 #include "chrome/browser/autofill/personal_data_manager.h"
15 #include "chrome/browser/autofill/personal_data_manager_factory.h" 15 #include "chrome/browser/autofill/personal_data_manager_factory.h"
16 #include "chrome/browser/history/history.h" 16 #include "chrome/browser/history/history.h"
17 #include "chrome/browser/prefs/pref_service.h"
18 #include "chrome/browser/prefs/session_startup_pref.h"
19 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/ui/browser.h" 18 #include "chrome/browser/ui/browser.h"
21 #include "chrome/common/url_constants.h" 19 #include "chrome/common/url_constants.h"
22 #include "chrome/test/base/ui_test_utils.h" 20 #include "chrome/test/base/ui_test_utils.h"
23 #include "ui/base/resource/resource_bundle.h" 21 #include "ui/base/resource/resource_bundle.h"
24 22
25 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) 23 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK)
26 #include <gtk/gtk.h> 24 #include <gtk/gtk.h>
27 #endif 25 #endif
28 26
(...skipping 23 matching lines...) Expand all
52 } 50 }
53 51
54 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(const char pageURL[], 52 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(const char pageURL[],
55 bool isRTL) { 53 bool isRTL) {
56 ui_test_utils::NavigateToURL(browser(), GURL(pageURL)); 54 ui_test_utils::NavigateToURL(browser(), GURL(pageURL));
57 ASSERT_TRUE(RunJavascriptTest("runBidiChecker", 55 ASSERT_TRUE(RunJavascriptTest("runBidiChecker",
58 Value::CreateStringValue(pageURL), 56 Value::CreateStringValue(pageURL),
59 Value::CreateBooleanValue(isRTL))); 57 Value::CreateBooleanValue(isRTL)));
60 } 58 }
61 59
62 void WebUIBidiCheckerBrowserTestLTR::RunBidiCheckerOnPage( 60 // WebUIBidiCheckerBrowserTestFakeBidi
63 const char pageURL[]) {
64 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(pageURL, false);
65 }
66 61
67 void WebUIBidiCheckerBrowserTestRTL::RunBidiCheckerOnPage( 62 WebUIBidiCheckerBrowserTestFakeBidi::~WebUIBidiCheckerBrowserTestFakeBidi() {}
68 const char pageURL[]) {
69 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(pageURL, true);
70 }
71 63
72 void WebUIBidiCheckerBrowserTestRTL::SetUpOnMainThread() { 64 WebUIBidiCheckerBrowserTestFakeBidi::WebUIBidiCheckerBrowserTestFakeBidi() {}
65
66 void WebUIBidiCheckerBrowserTestFakeBidi::SetUpOnMainThread() {
73 WebUIBidiCheckerBrowserTest::SetUpOnMainThread(); 67 WebUIBidiCheckerBrowserTest::SetUpOnMainThread();
74 FilePath pak_path; 68 FilePath pak_path;
75 app_locale_ = base::i18n::GetConfiguredLocale(); 69 app_locale_ = base::i18n::GetConfiguredLocale();
76 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path)); 70 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path));
77 pak_path = pak_path.DirName(); 71 pak_path = pak_path.DirName();
78 pak_path = pak_path.AppendASCII("pseudo_locales"); 72 pak_path = pak_path.AppendASCII("pseudo_locales");
79 pak_path = pak_path.AppendASCII("fake-bidi"); 73 pak_path = pak_path.AppendASCII("fake-bidi");
80 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak")); 74 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak"));
81 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path); 75 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path);
82 ResourceBundle::ReloadSharedInstance("he"); 76 ResourceBundle::ReloadSharedInstance("he");
83 base::i18n::SetICUDefaultLocale("he"); 77 base::i18n::SetICUDefaultLocale("he");
84 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) 78 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK)
85 gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL); 79 gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL);
86 #endif 80 #endif
87 } 81 }
88 82
89 void WebUIBidiCheckerBrowserTestRTL::CleanUpOnMainThread() { 83 void WebUIBidiCheckerBrowserTestFakeBidi::CleanUpOnMainThread() {
90 WebUIBidiCheckerBrowserTest::CleanUpOnMainThread(); 84 WebUIBidiCheckerBrowserTest::CleanUpOnMainThread();
91 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) 85 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK)
92 gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR); 86 gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR);
93 #endif 87 #endif
94 base::i18n::SetICUDefaultLocale(app_locale_); 88 base::i18n::SetICUDefaultLocale(app_locale_);
95 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(FilePath()); 89 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(FilePath());
96 ResourceBundle::ReloadSharedInstance(app_locale_); 90 ResourceBundle::ReloadSharedInstance(app_locale_);
97 } 91 }
98 92
99 // Tests 93 // Tests
100 94
101 //============================== 95 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestMainHistoryPageLTR) {
102 // chrome://history
103 //==============================
104
105 static void SetupHistoryPageTest(Browser* browser,
106 const std::string page_url,
107 const std::string page_title) {
108 HistoryService* history_service = 96 HistoryService* history_service =
109 browser->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); 97 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS);
110 const GURL history_url = GURL(page_url); 98 GURL history_url = GURL("http://www.ynet.co.il");
111 history_service->AddPage(history_url, history::SOURCE_BROWSED); 99 history_service->AddPage(history_url, history::SOURCE_BROWSED);
112 history_service->SetPageTitle(history_url, UTF8ToUTF16(page_title)); 100 string16 title;
101 ASSERT_TRUE(UTF8ToUTF16("\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21",
102 12,
103 &title));
104 history_service->SetPageTitle(history_url, title);
105 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL, false);
113 } 106 }
114 107
115 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestHistoryPage) { 108 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi,
116 // Test an Israeli news site with a Hebrew title. 109 TestMainHistoryPageRTL) {
117 SetupHistoryPageTest(browser(), 110 HistoryService* history_service =
118 "http://www.ynet.co.il", 111 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS);
119 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21"); 112 GURL history_url = GURL("http://www.google.com");
120 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL); 113 history_service->AddPage(history_url, history::SOURCE_BROWSED);
114 string16 title = UTF8ToUTF16("Google");
115 history_service->SetPageTitle(history_url, title);
116 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL,
117 true);
121 } 118 }
122 119
123 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHistoryPage) { 120 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestAboutPageLTR) {
124 SetupHistoryPageTest(browser(), "http://www.google.com", "Google"); 121 RunBidiCheckerOnPage(chrome::kChromeUIAboutURL, false);
125 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL);
126 } 122 }
127 123
128 //============================== 124 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestBugReportPageLTR) {
129 // chrome://about 125 RunBidiCheckerOnPage(chrome::kChromeUIBugReportURL, false);
130 //==============================
131
132 // This page isn't localized to an RTL language so we test it only in English.
133 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestAboutPage) {
134 RunBidiCheckerOnPage(chrome::kChromeUIAboutURL);
135 } 126 }
136 127
137 //============================== 128 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestCrashesPageLTR) {
138 // chrome://bugreport 129 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL, false);
139 //==============================
140
141 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestBugReportPage) {
142 // The bugreport page receives its contents as GET arguments. Here we provide
143 // a custom, Hebrew typed, description message.
144 RunBidiCheckerOnPage(
145 "chrome://bugreport#0?description=%D7%91%D7%93%D7%99%D7%A7%D7%94"
146 "&issueType=1");
147 } 130 }
148 131
149 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, 132 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi,
150 TestBugReportPage) { 133 TestCrashesPageRTL) {
151 RunBidiCheckerOnPage("chrome://bugreport#0?description=test&issueType=1"); 134 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUICrashesURL,
135 true);
152 } 136 }
153 137
154 //==============================
155 // chrome://crashes
156 //==============================
157
158 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestCrashesPage) {
159 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL);
160 }
161
162 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestCrashesPage) {
163 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL);
164 }
165
166 //==============================
167 // chrome://downloads
168 //==============================
169
170 #if defined(OS_WIN) || defined(OS_LINUX) 138 #if defined(OS_WIN) || defined(OS_LINUX)
171 // http://crbug.com/104129 139 // http://crbug.com/104129
172 #define TestDownloadsPageLTR FLAKY_TestDownloadsPage 140 #define TestDownloadsPageLTR FLAKY_TestDownloadsPageLTR
173 #endif 141 #endif
174 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestDownloadsPageLTR) { 142 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestDownloadsPageLTR) {
175 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL); 143 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL, false);
176 } 144 }
177 145
178 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestDownloadsPage) { 146 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi,
179 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL); 147 TestDownloadsPageRTL) {
148 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(
149 chrome::kChromeUIDownloadsURL, true);
180 } 150 }
181 151
182 //============================== 152 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestNewTabPageLTR) {
183 // chrome://newtab 153 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL, false);
184 //==============================
185
186 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestNewTabPage) {
187 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL);
188 } 154 }
189 155
190 // http://crbug.com/97453 156 // http://crbug.com/97453
191 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, 157 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi,
192 DISABLED_TestNewTabPage) { 158 DISABLED_TestNewTabPageRTL) {
193 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL); 159 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUINewTabURL,
160 true);
194 } 161 }
195 162
196 //============================== 163 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestPluginsPageLTR) {
197 // chrome://plugins 164 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL, false);
198 //==============================
199
200 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestPluginsPage) {
201 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL);
202 } 165 }
203 166
204 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestPluginsPage) { 167 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi,
205 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL); 168 TestPluginsPageRTL) {
169 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL,
170 true);
206 } 171 }
207 172
208 //============================== 173 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestSettingsPageLTR) {
209 // chrome://settings 174 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL, false);
210 //==============================
211
212 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestSettingsPage) {
213 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL);
214 } 175 }
215 176
216 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestSettingsPage) { 177 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi,
217 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL); 178 TestSettingsPageRTL) {
179 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(
180 chrome::kChromeUISettingsURL, true);
218 } 181 }
219 182
220 #if defined(OS_MACOSX) 183 #if defined(OS_MACOSX)
221 // http://crbug.com/94642 184 // http://crbug.com/94642
222 #define MAYBE_TestSettingsAutofillPage FLAKY_TestSettingsAutofillPage 185 #define MAYBE_TestSettingsAutofillPageLTR FLAKY_TestSettingsAutofillPageLTR
223 #elif defined(OS_WIN) 186 #elif defined(OS_WIN)
224 // http://crbug.com/95425 187 // http://crbug.com/95425
225 #define MAYBE_TestSettingsAutofillPage FAILS_TestSettingsAutofillPage 188 #define MAYBE_TestSettingsAutofillPageLTR FAILS_TestSettingsAutofillPageLTR
226 #else 189 #else
227 #define MAYBE_TestSettingsAutofillPage TestSettingsAutofillPage 190 #define MAYBE_TestSettingsAutofillPageLTR TestSettingsAutofillPageLTR
228 #endif // defined(OS_MACOSX) 191 #endif // defined(OS_MACOSX)
192 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest,
193 MAYBE_TestSettingsAutofillPageLTR) {
194 std::string url(chrome::kChromeUISettingsURL);
195 url += std::string(chrome::kAutofillSubPage);
229 196
230 static void SetupSettingsAutofillPageTest(Profile* profile, 197 autofill_test::DisableSystemServices(browser()->profile());
231 const char* first_name, 198 AutofillProfile profile;
232 const char* middle_name, 199 autofill_test::SetProfileInfo(
233 const char* last_name, 200 &profile,
234 const char* email, 201 "\xD7\x9E\xD7\xA9\xD7\x94",
235 const char* company, 202 "\xD7\x91",
236 const char* address1, 203 "\xD7\x9B\xD7\x94\xD7\x9F",
237 const char* address2, 204 "moshe.b.cohen@biditest.com",
238 const char* city, 205 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x20\xD7\x91\xD7\xA2\xD7\x9E",
239 const char* state, 206 "\xD7\x93\xD7\xA8\xD7\x9A\x20\xD7\x9E\xD7\xA0\xD7\x97\xD7\x9D\x20\xD7\x91\ xD7\x92\xD7\x99\xD7\x9F\x20\x32\x33",
240 const char* zipcode, 207 "\xD7\xA7\xD7\x95\xD7\x9E\xD7\x94\x20\x32\x36",
241 const char* country, 208 "\xD7\xAA\xD7\x9C\x20\xD7\x90\xD7\x91\xD7\x99\xD7\x91",
242 const char* phone) { 209 "",
243 autofill_test::DisableSystemServices(profile); 210 "66183",
244 AutofillProfile autofill_profile; 211 "\xD7\x99\xD7\xA9\xD7\xA8\xD7\x90\xD7\x9C",
245 autofill_test::SetProfileInfo(&autofill_profile, 212 "0000");
246 first_name, 213
247 middle_name,
248 last_name,
249 email,
250 company,
251 address1,
252 address2,
253 city,
254 state,
255 zipcode,
256 country,
257 phone);
258 PersonalDataManager* personal_data_manager = 214 PersonalDataManager* personal_data_manager =
259 PersonalDataManagerFactory::GetForProfile(profile); 215 PersonalDataManagerFactory::GetForProfile(browser()->profile());
260 ASSERT_TRUE(personal_data_manager); 216 ASSERT_TRUE(personal_data_manager);
261 personal_data_manager->AddProfile(autofill_profile); 217
218 personal_data_manager->AddProfile(profile);
219
220 RunBidiCheckerOnPage(url.c_str(), false);
262 } 221 }
263 222
264 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, 223 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi,
265 TestSettingsAutofillPage) { 224 TestSettingsAutofillPageRTL) {
266 SetupSettingsAutofillPageTest(browser()->profile(),
267 "\xD7\x9E\xD7\xA9\xD7\x94",
268 "\xD7\x91",
269 "\xD7\x9B\xD7\x94\xD7\x9F",
270 "moshe.b.cohen@biditest.com",
271 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x20"
272 "\xD7\x91\xD7\xA2\xD7\x9E",
273 "\xD7\x93\xD7\xA8\xD7\x9A\x20\xD7\x9E\xD7\xA0"
274 "\xD7\x97\xD7\x9D\x20\xD7\x91\xD7\x92\xD7"
275 "\x99\xD7\x9F\x20\x32\x33",
276 "\xD7\xA7\xD7\x95\xD7\x9E\xD7\x94\x20\x32\x36",
277 "\xD7\xAA\xD7\x9C\x20\xD7\x90\xD7\x91\xD7\x99"
278 "\xD7\x91",
279 "",
280 "66183",
281 "\xD7\x99\xD7\xA9\xD7\xA8\xD7\x90\xD7\x9C",
282 "0000");
283 std::string url(chrome::kChromeUISettingsURL); 225 std::string url(chrome::kChromeUISettingsURL);
284 url += std::string(chrome::kAutofillSubPage); 226 url += std::string(chrome::kAutofillSubPage);
285 RunBidiCheckerOnPage(url.c_str());
286 }
287 227
288 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, 228 autofill_test::DisableSystemServices(browser()->profile());
289 TestSettingsAutofillPage) { 229 AutofillProfile profile;
290 SetupSettingsAutofillPageTest(browser()->profile(), 230 autofill_test::SetProfileInfo(
231 &profile,
291 "Milton", 232 "Milton",
292 "C.", 233 "C.",
293 "Waddams", 234 "Waddams",
294 "red.swingline@initech.com", 235 "red.swingline@initech.com",
295 "Initech", 236 "Initech",
296 "4120 Freidrich Lane", 237 "4120 Freidrich Lane",
297 "Basement", 238 "Basement",
298 "Austin", 239 "Austin",
299 "Texas", 240 "Texas",
300 "78744", 241 "78744",
301 "United States", 242 "United States",
302 "5125551234"); 243 "5125551234");
303 std::string url(chrome::kChromeUISettingsURL); 244
304 url += std::string(chrome::kAutofillSubPage); 245 PersonalDataManager* personal_data_manager =
305 RunBidiCheckerOnPage(url.c_str()); 246 PersonalDataManagerFactory::GetForProfile(browser()->profile());
247 ASSERT_TRUE(personal_data_manager);
248
249 personal_data_manager->AddProfile(profile);
250
251 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(url.c_str(), true);
306 } 252 }
307
308 static void SetupSettingsBrowserOptionsTest(Profile* profile,
309 const GURL url,
310 const std::string title) {
311 // First, add a history entry for the site. This is needed so the site's
312 // name will appear in the startup sites lists.
313 HistoryService* history_service =
314 profile->GetHistoryService(Profile::IMPLICIT_ACCESS);
315 history_service->AddPage(url, history::SOURCE_BROWSED);
316 history_service->SetPageTitle(url, UTF8ToUTF16(title));
317 // Next, add the site to the startup sites
318 PrefService* prefs = profile->GetPrefs();
319 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs);
320 pref.urls.push_back(url);
321 SessionStartupPref::SetStartupPref(prefs, pref);
322 }
323
324 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
325 TestSettingsBrowserOptionsPage) {
326 SetupSettingsBrowserOptionsTest(browser()->profile(),
327 GURL("http://ynet.co.il"),
328 "\x79\x6E\x65\x74\x20\xD7\x97\xD7\x93\xD7"
329 "\xA9\xD7\x95\xD7\xAA\x20\xD7\xAA\xD7\x95"
330 "\xD7\x9B\xD7\x9F\x20\xD7\x95\xD7\xA2\xD7"
331 "\x93\xD7\x9B\xD7\x95\xD7\xA0\xD7\x99\xD7"
332 "\x9D\x20\x2D\x20\xD7\x99\xD7\x93\xD7\x99"
333 "\xD7\xA2\xD7\x95\xD7\xAA\x20\xD7\x90\xD7"
334 "\x97\xD7\xA8\xD7\x95\xD7\xA0\xD7\x95\xD7"
335 "\xAA");
336 std::string url(chrome::kChromeUISettingsURL);
337 url += std::string(chrome::kBrowserOptionsSubPage);
338 RunBidiCheckerOnPage(url.c_str());
339 }
340
341 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
342 TestSettingsBrowserOptionsPage) {
343 SetupSettingsBrowserOptionsTest(browser()->profile(),
344 GURL("http://google.com"),
345 "Google");
346 std::string url(chrome::kChromeUISettingsURL);
347 url += std::string(chrome::kBrowserOptionsSubPage);
348 RunBidiCheckerOnPage(url.c_str());
349 }
350
351 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
352 TestSettingsClearBrowserDataPage) {
353 std::string url(chrome::kChromeUISettingsURL);
354 url += std::string(chrome::kClearBrowserDataSubPage);
355 RunBidiCheckerOnPage(url.c_str());
356 }
357
358 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
359 TestSettingsClearBrowserDataPage) {
360 std::string url(chrome::kChromeUISettingsURL);
361 url += std::string(chrome::kClearBrowserDataSubPage);
362 RunBidiCheckerOnPage(url.c_str());
363 }
364
365 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
366 TestSettingsContentSettingsPage) {
367 std::string url(chrome::kChromeUISettingsURL);
368 url += std::string(chrome::kContentSettingsSubPage);
369 RunBidiCheckerOnPage(url.c_str());
370 }
371
372 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
373 TestSettingsContentSettingsPage) {
374 std::string url(chrome::kChromeUISettingsURL);
375 url += std::string(chrome::kContentSettingsSubPage);
376 RunBidiCheckerOnPage(url.c_str());
377 }
378
379 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
380 TestSettingsContentSettingsExceptionsPage) {
381 std::string url(chrome::kChromeUISettingsURL);
382 url += std::string(chrome::kContentSettingsExceptionsSubPage);
383 RunBidiCheckerOnPage(url.c_str());
384 }
385
386 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
387 TestSettingsContentSettingsExceptionsPage) {
388 std::string url(chrome::kChromeUISettingsURL);
389 url += std::string(chrome::kContentSettingsExceptionsSubPage);
390 RunBidiCheckerOnPage(url.c_str());
391 }
392
393 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
394 TestSettingsLanguageOptionsPage) {
395 std::string url(chrome::kChromeUISettingsURL);
396 url += std::string(chrome::kLanguageOptionsSubPage);
397 RunBidiCheckerOnPage(url.c_str());
398 }
399
400 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
401 TestSettingsLanguageOptionsPage) {
402 std::string url(chrome::kChromeUISettingsURL);
403 url += std::string(chrome::kLanguageOptionsSubPage);
404 RunBidiCheckerOnPage(url.c_str());
405 }
406
407 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
408 TestSettingsSearchEnginesOptionsPage) {
409 std::string url(chrome::kChromeUISettingsURL);
410 url += std::string(chrome::kSearchEnginesSubPage);
411 RunBidiCheckerOnPage(url.c_str());
412 }
413
414 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
415 TestSettingsSearchEnginesOptionsPage) {
416 std::string url(chrome::kChromeUISettingsURL);
417 url += std::string(chrome::kSearchEnginesSubPage);
418 RunBidiCheckerOnPage(url.c_str());
419 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/bidi_checker_web_ui_test.h ('k') | chrome/test/data/webui/bidichecker_tests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698