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

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

Issue 8678005: reland r110861 reverted after fixing ChromeOS failure. (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"
17 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/browser.h" 20 #include "chrome/browser/ui/browser.h"
19 #include "chrome/common/url_constants.h" 21 #include "chrome/common/url_constants.h"
20 #include "chrome/test/base/ui_test_utils.h" 22 #include "chrome/test/base/ui_test_utils.h"
21 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
22 24
23 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) 25 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK)
24 #include <gtk/gtk.h> 26 #include <gtk/gtk.h>
25 #endif 27 #endif
26 28
(...skipping 23 matching lines...) Expand all
50 } 52 }
51 53
52 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(const char pageURL[], 54 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(const char pageURL[],
53 bool isRTL) { 55 bool isRTL) {
54 ui_test_utils::NavigateToURL(browser(), GURL(pageURL)); 56 ui_test_utils::NavigateToURL(browser(), GURL(pageURL));
55 ASSERT_TRUE(RunJavascriptTest("runBidiChecker", 57 ASSERT_TRUE(RunJavascriptTest("runBidiChecker",
56 Value::CreateStringValue(pageURL), 58 Value::CreateStringValue(pageURL),
57 Value::CreateBooleanValue(isRTL))); 59 Value::CreateBooleanValue(isRTL)));
58 } 60 }
59 61
60 // WebUIBidiCheckerBrowserTestFakeBidi 62 void WebUIBidiCheckerBrowserTestLTR::RunBidiCheckerOnPage(
63 const char pageURL[]) {
64 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(pageURL, false);
65 }
61 66
62 WebUIBidiCheckerBrowserTestFakeBidi::~WebUIBidiCheckerBrowserTestFakeBidi() {} 67 void WebUIBidiCheckerBrowserTestRTL::RunBidiCheckerOnPage(
68 const char pageURL[]) {
69 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(pageURL, true);
70 }
63 71
64 WebUIBidiCheckerBrowserTestFakeBidi::WebUIBidiCheckerBrowserTestFakeBidi() {} 72 void WebUIBidiCheckerBrowserTestRTL::SetUpOnMainThread() {
65
66 void WebUIBidiCheckerBrowserTestFakeBidi::SetUpOnMainThread() {
67 WebUIBidiCheckerBrowserTest::SetUpOnMainThread(); 73 WebUIBidiCheckerBrowserTest::SetUpOnMainThread();
68 FilePath pak_path; 74 FilePath pak_path;
69 app_locale_ = base::i18n::GetConfiguredLocale(); 75 app_locale_ = base::i18n::GetConfiguredLocale();
70 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path)); 76 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path));
71 pak_path = pak_path.DirName(); 77 pak_path = pak_path.DirName();
72 pak_path = pak_path.AppendASCII("pseudo_locales"); 78 pak_path = pak_path.AppendASCII("pseudo_locales");
73 pak_path = pak_path.AppendASCII("fake-bidi"); 79 pak_path = pak_path.AppendASCII("fake-bidi");
74 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak")); 80 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak"));
75 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path); 81 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path);
76 ResourceBundle::ReloadSharedInstance("he"); 82 ResourceBundle::ReloadSharedInstance("he");
77 base::i18n::SetICUDefaultLocale("he"); 83 base::i18n::SetICUDefaultLocale("he");
78 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) 84 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK)
79 gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL); 85 gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL);
80 #endif 86 #endif
81 } 87 }
82 88
83 void WebUIBidiCheckerBrowserTestFakeBidi::CleanUpOnMainThread() { 89 void WebUIBidiCheckerBrowserTestRTL::CleanUpOnMainThread() {
84 WebUIBidiCheckerBrowserTest::CleanUpOnMainThread(); 90 WebUIBidiCheckerBrowserTest::CleanUpOnMainThread();
85 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) 91 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK)
86 gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR); 92 gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR);
87 #endif 93 #endif
88 base::i18n::SetICUDefaultLocale(app_locale_); 94 base::i18n::SetICUDefaultLocale(app_locale_);
89 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(FilePath()); 95 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(FilePath());
90 ResourceBundle::ReloadSharedInstance(app_locale_); 96 ResourceBundle::ReloadSharedInstance(app_locale_);
91 } 97 }
92 98
93 // Tests 99 // Tests
94 100
95 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestMainHistoryPageLTR) { 101 //==============================
102 // chrome://history
103 //==============================
104
105 static void SetupHistoryPageTest(Browser* browser,
106 const std::string page_url,
107 const std::string page_title) {
96 HistoryService* history_service = 108 HistoryService* history_service =
97 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); 109 browser->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS);
98 GURL history_url = GURL("http://www.ynet.co.il"); 110 const GURL history_url = GURL(page_url);
99 history_service->AddPage(history_url, history::SOURCE_BROWSED); 111 history_service->AddPage(history_url, history::SOURCE_BROWSED);
100 string16 title; 112 history_service->SetPageTitle(history_url, UTF8ToUTF16(page_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);
106 } 113 }
107 114
108 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, 115 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestHistoryPage) {
109 TestMainHistoryPageRTL) { 116 // Test an Israeli news site with a Hebrew title.
110 HistoryService* history_service = 117 SetupHistoryPageTest(browser(),
111 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); 118 "http://www.ynet.co.il",
112 GURL history_url = GURL("http://www.google.com"); 119 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21");
113 history_service->AddPage(history_url, history::SOURCE_BROWSED); 120 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL);
114 string16 title = UTF8ToUTF16("Google");
115 history_service->SetPageTitle(history_url, title);
116 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL,
117 true);
118 } 121 }
119 122
120 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestAboutPageLTR) { 123 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHistoryPage) {
121 RunBidiCheckerOnPage(chrome::kChromeUIAboutURL, false); 124 SetupHistoryPageTest(browser(), "http://www.google.com", "Google");
125 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL);
122 } 126 }
123 127
124 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestBugReportPageLTR) { 128 //==============================
125 RunBidiCheckerOnPage(chrome::kChromeUIBugReportURL, false); 129 // chrome://about
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);
126 } 135 }
127 136
128 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestCrashesPageLTR) { 137 //==============================
129 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL, false); 138 // chrome://bugreport
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");
130 } 147 }
131 148
132 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, 149 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
133 TestCrashesPageRTL) { 150 TestBugReportPage) {
134 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUICrashesURL, 151 RunBidiCheckerOnPage("chrome://bugreport#0?description=test&issueType=1");
135 true);
136 } 152 }
137 153
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
138 #if defined(OS_WIN) || defined(OS_LINUX) 170 #if defined(OS_WIN) || defined(OS_LINUX)
139 // http://crbug.com/104129 171 // http://crbug.com/104129
140 #define TestDownloadsPageLTR FLAKY_TestDownloadsPageLTR 172 #define TestDownloadsPageLTR FLAKY_TestDownloadsPage
141 #endif 173 #endif
142 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestDownloadsPageLTR) { 174 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestDownloadsPageLTR) {
143 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL, false); 175 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL);
144 } 176 }
145 177
146 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, 178 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestDownloadsPage) {
147 TestDownloadsPageRTL) { 179 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL);
148 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(
149 chrome::kChromeUIDownloadsURL, true);
150 } 180 }
151 181
152 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestNewTabPageLTR) { 182 //==============================
153 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL, false); 183 // chrome://newtab
184 //==============================
185
186 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestNewTabPage) {
187 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL);
154 } 188 }
155 189
156 // http://crbug.com/97453 190 // http://crbug.com/97453
157 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, 191 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
158 DISABLED_TestNewTabPageRTL) { 192 DISABLED_TestNewTabPage) {
159 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUINewTabURL, 193 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL);
160 true);
161 } 194 }
162 195
163 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestPluginsPageLTR) { 196 //==============================
164 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL, false); 197 // chrome://plugins
198 //==============================
199
200 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestPluginsPage) {
201 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL);
165 } 202 }
166 203
167 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, 204 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestPluginsPage) {
168 TestPluginsPageRTL) { 205 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL);
169 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL,
170 true);
171 } 206 }
172 207
173 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestSettingsPageLTR) { 208 //==============================
174 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL, false); 209 // chrome://settings
210 //==============================
211
212 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestSettingsPage) {
213 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL);
175 } 214 }
176 215
177 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, 216 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestSettingsPage) {
178 TestSettingsPageRTL) { 217 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL);
179 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(
180 chrome::kChromeUISettingsURL, true);
181 } 218 }
182 219
183 #if defined(OS_MACOSX) 220 #if defined(OS_MACOSX)
184 // http://crbug.com/94642 221 // http://crbug.com/94642
185 #define MAYBE_TestSettingsAutofillPageLTR FLAKY_TestSettingsAutofillPageLTR 222 #define MAYBE_TestSettingsAutofillPage FLAKY_TestSettingsAutofillPage
186 #elif defined(OS_WIN) 223 #elif defined(OS_WIN)
187 // http://crbug.com/95425 224 // http://crbug.com/95425
188 #define MAYBE_TestSettingsAutofillPageLTR FAILS_TestSettingsAutofillPageLTR 225 #define MAYBE_TestSettingsAutofillPage FAILS_TestSettingsAutofillPage
189 #else 226 #else
190 #define MAYBE_TestSettingsAutofillPageLTR TestSettingsAutofillPageLTR 227 #define MAYBE_TestSettingsAutofillPage TestSettingsAutofillPage
191 #endif // defined(OS_MACOSX) 228 #endif // defined(OS_MACOSX)
192 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, 229
193 MAYBE_TestSettingsAutofillPageLTR) { 230 static void SetupSettingsAutofillPageTest(Profile* profile,
231 const char* first_name,
232 const char* middle_name,
233 const char* last_name,
234 const char* email,
235 const char* company,
236 const char* address1,
237 const char* address2,
238 const char* city,
239 const char* state,
240 const char* zipcode,
241 const char* country,
242 const char* phone) {
243 autofill_test::DisableSystemServices(profile);
244 AutofillProfile autofill_profile;
245 autofill_test::SetProfileInfo(&autofill_profile,
246 first_name,
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 =
259 PersonalDataManagerFactory::GetForProfile(profile);
260 ASSERT_TRUE(personal_data_manager);
261 personal_data_manager->AddProfile(autofill_profile);
262 }
263
264 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
265 TestSettingsAutofillPage) {
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");
194 std::string url(chrome::kChromeUISettingsURL); 283 std::string url(chrome::kChromeUISettingsURL);
195 url += std::string(chrome::kAutofillSubPage); 284 url += std::string(chrome::kAutofillSubPage);
196 285 RunBidiCheckerOnPage(url.c_str());
197 autofill_test::DisableSystemServices(browser()->profile());
198 AutofillProfile profile;
199 autofill_test::SetProfileInfo(
200 &profile,
201 "\xD7\x9E\xD7\xA9\xD7\x94",
202 "\xD7\x91",
203 "\xD7\x9B\xD7\x94\xD7\x9F",
204 "moshe.b.cohen@biditest.com",
205 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x20\xD7\x91\xD7\xA2\xD7\x9E",
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",
207 "\xD7\xA7\xD7\x95\xD7\x9E\xD7\x94\x20\x32\x36",
208 "\xD7\xAA\xD7\x9C\x20\xD7\x90\xD7\x91\xD7\x99\xD7\x91",
209 "",
210 "66183",
211 "\xD7\x99\xD7\xA9\xD7\xA8\xD7\x90\xD7\x9C",
212 "0000");
213
214 PersonalDataManager* personal_data_manager =
215 PersonalDataManagerFactory::GetForProfile(browser()->profile());
216 ASSERT_TRUE(personal_data_manager);
217
218 personal_data_manager->AddProfile(profile);
219
220 RunBidiCheckerOnPage(url.c_str(), false);
221 } 286 }
222 287
223 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, 288 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
224 TestSettingsAutofillPageRTL) { 289 TestSettingsAutofillPage) {
225 std::string url(chrome::kChromeUISettingsURL); 290 SetupSettingsAutofillPageTest(browser()->profile(),
226 url += std::string(chrome::kAutofillSubPage);
227
228 autofill_test::DisableSystemServices(browser()->profile());
229 AutofillProfile profile;
230 autofill_test::SetProfileInfo(
231 &profile,
232 "Milton", 291 "Milton",
233 "C.", 292 "C.",
234 "Waddams", 293 "Waddams",
235 "red.swingline@initech.com", 294 "red.swingline@initech.com",
236 "Initech", 295 "Initech",
237 "4120 Freidrich Lane", 296 "4120 Freidrich Lane",
238 "Basement", 297 "Basement",
239 "Austin", 298 "Austin",
240 "Texas", 299 "Texas",
241 "78744", 300 "78744",
242 "United States", 301 "United States",
243 "5125551234"); 302 "5125551234");
303 std::string url(chrome::kChromeUISettingsURL);
304 url += std::string(chrome::kAutofillSubPage);
305 RunBidiCheckerOnPage(url.c_str());
306 }
244 307
245 PersonalDataManager* personal_data_manager = 308 static void SetupSettingsBrowserOptionsTest(Profile* profile,
246 PersonalDataManagerFactory::GetForProfile(browser()->profile()); 309 const GURL url,
247 ASSERT_TRUE(personal_data_manager); 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 }
248 323
249 personal_data_manager->AddProfile(profile); 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 }
250 340
251 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(url.c_str(), true); 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());
252 } 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