Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / webui / bidi_checker_web_ui_test.cc
blob07888f69bb6b386049345912d4cbd806638e7942
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/webui/bidi_checker_web_ui_test.h"
7 #include "base/base_paths.h"
8 #include "base/i18n/rtl.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/path_service.h"
11 #include "base/prefs/pref_service.h"
12 #include "base/strings/utf_string_conversions.h"
13 #include "base/synchronization/waitable_event.h"
14 #include "base/threading/platform_thread.h"
15 #include "base/time/time.h"
16 #include "base/values.h"
17 #include "chrome/browser/autofill/personal_data_manager_factory.h"
18 #include "chrome/browser/history/history_service.h"
19 #include "chrome/browser/history/history_service_factory.h"
20 #include "chrome/browser/prefs/session_startup_pref.h"
21 #include "chrome/browser/profiles/profile.h"
22 #include "chrome/browser/ui/browser.h"
23 #include "chrome/common/url_constants.h"
24 #include "chrome/test/base/ui_test_utils.h"
25 #include "components/autofill/core/browser/autofill_profile.h"
26 #include "components/autofill/core/browser/autofill_test_utils.h"
27 #include "components/autofill/core/browser/personal_data_manager.h"
28 #include "content/public/browser/browser_thread.h"
29 #include "ui/base/resource/resource_bundle.h"
31 #if defined(TOOLKIT_GTK)
32 #include <gtk/gtk.h>
33 #endif
35 using autofill::AutofillProfile;
36 using autofill::PersonalDataManager;
38 static const base::FilePath::CharType* kWebUIBidiCheckerLibraryJS =
39 FILE_PATH_LITERAL("third_party/bidichecker/bidichecker_packaged.js");
41 namespace {
42 base::FilePath WebUIBidiCheckerLibraryJSPath() {
43 base::FilePath src_root;
44 if (!PathService::Get(base::DIR_SOURCE_ROOT, &src_root))
45 LOG(ERROR) << "Couldn't find source root";
46 return src_root.Append(kWebUIBidiCheckerLibraryJS);
49 // Since synchronization isn't complete for the ResourceBundle class, reload
50 // locale resources on the IO thread.
51 // crbug.com/95425, crbug.com/132752
52 void ReloadLocaleResourcesOnIOThread(const std::string& new_locale) {
53 if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
54 LOG(ERROR)
55 << content::BrowserThread::IO
56 << " != " << base::PlatformThread::CurrentId();
57 NOTREACHED();
60 std::string locale;
62 base::ThreadRestrictions::ScopedAllowIO allow_io_scope;
63 locale.assign(
64 ResourceBundle::GetSharedInstance().ReloadLocaleResources(new_locale));
66 ASSERT_FALSE(locale.empty());
69 // Since synchronization isn't complete for the ResourceBundle class, reload
70 // locale resources on the IO thread.
71 // crbug.com/95425, crbug.com/132752
72 void ReloadLocaleResources(const std::string& new_locale) {
73 content::BrowserThread::PostTaskAndReply(
74 content::BrowserThread::IO,
75 FROM_HERE,
76 base::Bind(&ReloadLocaleResourcesOnIOThread, base::ConstRef(new_locale)),
77 base::MessageLoop::QuitClosure());
78 content::RunMessageLoop();
81 } // namespace
83 static const base::FilePath::CharType* kBidiCheckerTestsJS =
84 FILE_PATH_LITERAL("bidichecker_tests.js");
86 void WebUIBidiCheckerBrowserTest::SetUp() {
87 argv_ = CommandLine::ForCurrentProcess()->GetArgs();
90 void WebUIBidiCheckerBrowserTest::TearDown() {
91 // Reset command line to the way it was before the test was run.
92 CommandLine::ForCurrentProcess()->InitFromArgv(argv_);
95 WebUIBidiCheckerBrowserTest::~WebUIBidiCheckerBrowserTest() {}
97 WebUIBidiCheckerBrowserTest::WebUIBidiCheckerBrowserTest() {}
99 void WebUIBidiCheckerBrowserTest::SetUpInProcessBrowserTestFixture() {
100 WebUIBrowserTest::SetUpInProcessBrowserTestFixture();
101 WebUIBrowserTest::AddLibrary(WebUIBidiCheckerLibraryJSPath());
102 WebUIBrowserTest::AddLibrary(base::FilePath(kBidiCheckerTestsJS));
105 void WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(
106 const std::string& page_url, bool is_rtl) {
107 ui_test_utils::NavigateToURL(browser(), GURL(page_url));
108 ASSERT_TRUE(RunJavascriptTest("runBidiChecker",
109 base::Value::CreateStringValue(page_url),
110 base::Value::CreateBooleanValue(is_rtl)));
113 void WebUIBidiCheckerBrowserTestLTR::RunBidiCheckerOnPage(
114 const std::string& page_url) {
115 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(page_url, false);
118 void WebUIBidiCheckerBrowserTestRTL::RunBidiCheckerOnPage(
119 const std::string& page_url) {
120 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(page_url, true);
123 void WebUIBidiCheckerBrowserTestRTL::SetUpOnMainThread() {
124 WebUIBidiCheckerBrowserTest::SetUpOnMainThread();
125 base::FilePath pak_path;
126 app_locale_ = base::i18n::GetConfiguredLocale();
127 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path));
128 pak_path = pak_path.DirName();
129 pak_path = pak_path.AppendASCII("pseudo_locales");
130 pak_path = pak_path.AppendASCII("fake-bidi");
131 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak"));
132 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path);
133 ReloadLocaleResources("he");
134 base::i18n::SetICUDefaultLocale("he");
135 #if defined(OS_POSIX) && defined(TOOLKIT_GTK)
136 gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL);
137 #endif
140 void WebUIBidiCheckerBrowserTestRTL::CleanUpOnMainThread() {
141 WebUIBidiCheckerBrowserTest::CleanUpOnMainThread();
142 #if defined(OS_POSIX) && defined(TOOLKIT_GTK)
143 gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR);
144 #endif
146 base::i18n::SetICUDefaultLocale(app_locale_);
147 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(
148 base::FilePath());
149 ReloadLocaleResources(app_locale_);
152 // Tests
154 //==============================
155 // chrome://settings/history
156 //==============================
158 static void SetupHistoryPageTest(Browser* browser,
159 const std::string& page_url,
160 const std::string& page_title) {
161 HistoryService* history_service = HistoryServiceFactory::GetForProfile(
162 browser->profile(), Profile::IMPLICIT_ACCESS);
163 const GURL history_url = GURL(page_url);
164 history_service->AddPage(
165 history_url, base::Time::Now(), history::SOURCE_BROWSED);
166 history_service->SetPageTitle(history_url, base::UTF8ToUTF16(page_title));
169 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
170 TestHistoryPage) {
171 // Test an Israeli news site with a Hebrew title.
172 SetupHistoryPageTest(browser(),
173 "http://www.ynet.co.il",
174 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21");
175 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL);
178 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
179 TestHistoryPage) {
180 SetupHistoryPageTest(browser(), "http://www.google.com", "Google");
181 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL);
184 //==============================
185 // chrome://about
186 //==============================
188 // This page isn't localized to an RTL language so we test it only in English.
189 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestAboutPage) {
190 RunBidiCheckerOnPage(chrome::kChromeUIAboutURL);
193 //==============================
194 // chrome://crashes
195 //==============================
197 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestCrashesPage) {
198 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL);
201 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestCrashesPage) {
202 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL);
205 //==============================
206 // chrome://downloads
207 //==============================
209 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
210 TestDownloadsPageLTR) {
211 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL);
214 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
215 TestDownloadsPageRTL) {
216 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL);
219 //==============================
220 // chrome://newtab
221 //==============================
223 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestNewTabPage) {
224 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL);
227 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestNewTabPage) {
228 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL);
231 //==============================
232 // chrome://plugins
233 //==============================
235 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestPluginsPage) {
236 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL);
239 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestPluginsPage) {
240 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL);
243 //==============================
244 // chrome://settings-frame
245 //==============================
247 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestSettingsPage) {
248 RunBidiCheckerOnPage(chrome::kChromeUISettingsFrameURL);
251 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestSettingsPage) {
252 RunBidiCheckerOnPage(chrome::kChromeUISettingsFrameURL);
255 static void SetupSettingsAutofillPageTest(Profile* profile,
256 const char* first_name,
257 const char* middle_name,
258 const char* last_name,
259 const char* email,
260 const char* company,
261 const char* address1,
262 const char* address2,
263 const char* city,
264 const char* state,
265 const char* zipcode,
266 const char* country,
267 const char* phone) {
268 autofill::test::DisableSystemServices(profile);
269 AutofillProfile autofill_profile;
270 autofill::test::SetProfileInfo(&autofill_profile,
271 first_name,
272 middle_name,
273 last_name,
274 email,
275 company,
276 address1,
277 address2,
278 city,
279 state,
280 zipcode,
281 country,
282 phone);
283 PersonalDataManager* personal_data_manager =
284 autofill::PersonalDataManagerFactory::GetForProfile(profile);
285 ASSERT_TRUE(personal_data_manager);
286 personal_data_manager->AddProfile(autofill_profile);
289 // http://crbug.com/94642
290 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
291 DISABLED_TestSettingsAutofillPage) {
292 SetupSettingsAutofillPageTest(browser()->profile(),
293 "\xD7\x9E\xD7\xA9\xD7\x94",
294 "\xD7\x91",
295 "\xD7\x9B\xD7\x94\xD7\x9F",
296 "moshe.b.cohen@biditest.com",
297 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x20"
298 "\xD7\x91\xD7\xA2\xD7\x9E",
299 "\xD7\x93\xD7\xA8\xD7\x9A\x20\xD7\x9E\xD7\xA0"
300 "\xD7\x97\xD7\x9D\x20\xD7\x91\xD7\x92\xD7"
301 "\x99\xD7\x9F\x20\x32\x33",
302 "\xD7\xA7\xD7\x95\xD7\x9E\xD7\x94\x20\x32\x36",
303 "\xD7\xAA\xD7\x9C\x20\xD7\x90\xD7\x91\xD7\x99"
304 "\xD7\x91",
306 "66183",
307 "\xD7\x99\xD7\xA9\xD7\xA8\xD7\x90\xD7\x9C",
308 "0000");
309 std::string url(chrome::kChromeUISettingsFrameURL);
310 url += std::string(chrome::kAutofillSubPage);
311 RunBidiCheckerOnPage(url);
314 // http://crbug.com/94642
315 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
316 DISABLED_TestSettingsAutofillPage) {
317 SetupSettingsAutofillPageTest(browser()->profile(),
318 "Milton",
319 "C.",
320 "Waddams",
321 "red.swingline@initech.com",
322 "Initech",
323 "4120 Freidrich Lane",
324 "Basement",
325 "Austin",
326 "Texas",
327 "78744",
328 "United States",
329 "5125551234");
330 std::string url(chrome::kChromeUISettingsFrameURL);
331 url += std::string(chrome::kAutofillSubPage);
332 RunBidiCheckerOnPage(url);
335 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
336 TestSettingsClearBrowserDataPage) {
337 std::string url(chrome::kChromeUISettingsFrameURL);
338 url += std::string(chrome::kClearBrowserDataSubPage);
339 RunBidiCheckerOnPage(url);
342 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
343 TestSettingsClearBrowserDataPage) {
344 std::string url(chrome::kChromeUISettingsFrameURL);
345 url += std::string(chrome::kClearBrowserDataSubPage);
346 RunBidiCheckerOnPage(url);
349 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
350 TestSettingsContentSettingsPage) {
351 std::string url(chrome::kChromeUISettingsFrameURL);
352 url += std::string(chrome::kContentSettingsSubPage);
353 RunBidiCheckerOnPage(url);
356 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
357 TestSettingsContentSettingsPage) {
358 std::string url(chrome::kChromeUISettingsFrameURL);
359 url += std::string(chrome::kContentSettingsSubPage);
360 RunBidiCheckerOnPage(url);
363 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
364 TestSettingsContentSettingsExceptionsPage) {
365 std::string url(chrome::kChromeUISettingsFrameURL);
366 url += std::string(chrome::kContentSettingsExceptionsSubPage);
367 RunBidiCheckerOnPage(url);
370 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
371 TestSettingsContentSettingsExceptionsPage) {
372 std::string url(chrome::kChromeUISettingsFrameURL);
373 url += std::string(chrome::kContentSettingsExceptionsSubPage);
374 RunBidiCheckerOnPage(url);
377 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
378 TestSettingsLanguageOptionsPage) {
379 std::string url(chrome::kChromeUISettingsFrameURL);
380 url += std::string(chrome::kLanguageOptionsSubPage);
381 RunBidiCheckerOnPage(url);
384 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
385 TestSettingsLanguageOptionsPage) {
386 std::string url(chrome::kChromeUISettingsFrameURL);
387 url += std::string(chrome::kLanguageOptionsSubPage);
388 RunBidiCheckerOnPage(url);
391 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
392 TestSettingsSearchEnginesOptionsPage) {
393 std::string url(chrome::kChromeUISettingsFrameURL);
394 url += std::string(chrome::kSearchEnginesSubPage);
395 RunBidiCheckerOnPage(url);
398 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
399 TestSettingsSearchEnginesOptionsPage) {
400 std::string url(chrome::kChromeUISettingsFrameURL);
401 url += std::string(chrome::kSearchEnginesSubPage);
402 RunBidiCheckerOnPage(url);
405 //===================================
406 // chrome://settings-frame/startup
407 //===================================
409 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
410 TestSettingsFrameStartup) {
411 std::string url(chrome::kChromeUISettingsFrameURL);
412 url += "startup";
413 RunBidiCheckerOnPage(url);
416 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
417 TestSettingsFrameStartup) {
418 std::string url(chrome::kChromeUISettingsFrameURL);
419 url += "startup";
420 RunBidiCheckerOnPage(url);
423 //===================================
424 // chrome://settings-frame/importData
425 //===================================
427 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
428 TestSettingsFrameImportData) {
429 std::string url(chrome::kChromeUISettingsFrameURL);
430 url += chrome::kImportDataSubPage;
431 RunBidiCheckerOnPage(url);
434 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
435 TestSettingsFrameImportData) {
436 std::string url(chrome::kChromeUISettingsFrameURL);
437 url += chrome::kImportDataSubPage;
438 RunBidiCheckerOnPage(url);
441 //========================================
442 // chrome://settings-frame/manageProfile
443 //========================================
445 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
446 TestSettingsFrameMangageProfile) {
447 std::string url(chrome::kChromeUISettingsFrameURL);
448 url += chrome::kManageProfileSubPage;
449 RunBidiCheckerOnPage(url);
452 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
453 TestSettingsFrameMangageProfile) {
454 std::string url(chrome::kChromeUISettingsFrameURL);
455 url += chrome::kManageProfileSubPage;
456 RunBidiCheckerOnPage(url);
459 //===================================================
460 // chrome://settings-frame/contentExceptions#cookies
461 //===================================================
463 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
464 TestSettingsFrameContentExceptionsCookies) {
465 std::string url(chrome::kChromeUISettingsFrameURL);
466 url += chrome::kContentSettingsExceptionsSubPage;
467 url += "#cookies";
468 RunBidiCheckerOnPage(url);
471 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
472 TestSettingsFrameContentExceptionsCookies) {
473 std::string url(chrome::kChromeUISettingsFrameURL);
474 url += chrome::kContentSettingsExceptionsSubPage;
475 url += "#cookies";
476 RunBidiCheckerOnPage(url);
479 //===================================================
480 // chrome://settings-frame/contentExceptions#images
481 //===================================================
483 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
484 TestSettingsFrameContentExceptionsImages) {
485 std::string url(chrome::kChromeUISettingsFrameURL);
486 url += chrome::kContentSettingsExceptionsSubPage;
487 url += "#images";
488 RunBidiCheckerOnPage(url);
491 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
492 TestSettingsFrameContentExceptionsImages) {
493 std::string url(chrome::kChromeUISettingsFrameURL);
494 url += chrome::kContentSettingsExceptionsSubPage;
495 url += "#images";
496 RunBidiCheckerOnPage(url);
499 //======================================================
500 // chrome://settings-frame/contentExceptions#javascript
501 //======================================================
503 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
504 TestSettingsFrameContentExceptionsJavascript) {
505 std::string url(chrome::kChromeUISettingsFrameURL);
506 url += chrome::kContentSettingsExceptionsSubPage;
507 url += "#javascript";
508 RunBidiCheckerOnPage(url);
511 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
512 TestSettingsFrameContentExceptionsJavascript) {
513 std::string url(chrome::kChromeUISettingsFrameURL);
514 url += chrome::kContentSettingsExceptionsSubPage;
515 url += "#javascript";
516 RunBidiCheckerOnPage(url);
519 //===================================================
520 // chrome://settings-frame/contentExceptions#plugins
521 //===================================================
523 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
524 TestSettingsFrameContentExceptionsPlugins) {
525 std::string url(chrome::kChromeUISettingsFrameURL);
526 url += chrome::kContentSettingsExceptionsSubPage;
527 url += "#plugins";
528 RunBidiCheckerOnPage(url);
531 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
532 TestSettingsFrameContentExceptionsPlugins) {
533 std::string url(chrome::kChromeUISettingsFrameURL);
534 url += chrome::kContentSettingsExceptionsSubPage;
535 url += "#plugins";
536 RunBidiCheckerOnPage(url);
539 //===================================================
540 // chrome://settings-frame/contentExceptions#popups
541 //===================================================
543 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
544 TestSettingsFrameContentExceptionsPopups) {
545 std::string url(chrome::kChromeUISettingsFrameURL);
546 url += chrome::kContentSettingsExceptionsSubPage;
547 url += "#popups";
548 RunBidiCheckerOnPage(url);
551 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
552 TestSettingsFrameContentExceptionsPopups) {
553 std::string url(chrome::kChromeUISettingsFrameURL);
554 url += chrome::kContentSettingsExceptionsSubPage;
555 url += "#popups";
556 RunBidiCheckerOnPage(url);
559 //===================================================
560 // chrome://settings-frame/contentExceptions#location
561 //===================================================
563 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
564 TestSettingsFrameContentExceptionsLocation) {
565 std::string url(chrome::kChromeUISettingsFrameURL);
566 url += chrome::kContentSettingsExceptionsSubPage;
567 url += "#location";
568 RunBidiCheckerOnPage(url);
571 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
572 TestSettingsFrameContentExceptionsLocation) {
573 std::string url(chrome::kChromeUISettingsFrameURL);
574 url += chrome::kContentSettingsExceptionsSubPage;
575 url += "#location";
576 RunBidiCheckerOnPage(url);
579 //===================================================
580 // chrome://settings-frame/contentExceptions#notifications
581 //===================================================
583 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
584 TestSettingsFrameContentExceptionsNotifications) {
585 std::string url(chrome::kChromeUISettingsFrameURL);
586 url += chrome::kContentSettingsExceptionsSubPage;
587 url += "#notifications";
588 RunBidiCheckerOnPage(url);
591 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
592 TestSettingsFrameContentExceptionsNotifications) {
593 std::string url(chrome::kChromeUISettingsFrameURL);
594 url += chrome::kContentSettingsExceptionsSubPage;
595 url += "#notifications";
596 RunBidiCheckerOnPage(url);
599 //===================================================
600 // chrome://settings-frame/contentExceptions#mouselock
601 //===================================================
603 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
604 TestSettingsFrameContentExceptionsMouseLock) {
605 std::string url(chrome::kChromeUISettingsFrameURL);
606 url += chrome::kContentSettingsExceptionsSubPage;
607 url += "#mouselock";
608 RunBidiCheckerOnPage(url);
611 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
612 TestSettingsFrameContentExceptionsMouseLock) {
613 std::string url(chrome::kChromeUISettingsFrameURL);
614 url += chrome::kContentSettingsExceptionsSubPage;
615 url += "#mouselock";
616 RunBidiCheckerOnPage(url);
619 //========================================
620 // chrome://settings-frame/handlers
621 //========================================
623 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
624 TestSettingsFrameHandler) {
625 std::string url(chrome::kChromeUISettingsFrameURL);
626 url += chrome::kHandlerSettingsSubPage;
627 RunBidiCheckerOnPage(url);
630 // Fails on chromeos. http://crbug.com/125367
631 #if defined(OS_CHROMEOS)
632 #define MAYBE_TestSettingsFrameHandler DISABLED_TestSettingsFrameHandler
633 #else
634 #define MAYBE_TestSettingsFrameHandler TestSettingsFrameHandler
635 #endif
637 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
638 MAYBE_TestSettingsFrameHandler) {
639 std::string url(chrome::kChromeUISettingsFrameURL);
640 url += chrome::kHandlerSettingsSubPage;
641 RunBidiCheckerOnPage(url);
644 //========================================
645 // chrome://settings-frame/cookies
646 //========================================
648 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
649 TestSettingsFrameCookies) {
650 std::string url(chrome::kChromeUISettingsFrameURL);
651 url += "cookies";
652 RunBidiCheckerOnPage(url);
655 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
656 TestSettingsFrameCookies) {
657 std::string url(chrome::kChromeUISettingsFrameURL);
658 url += "cookies";
659 RunBidiCheckerOnPage(url);
662 //========================================
663 // chrome://settings-frame/passwords
664 //========================================
666 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
667 TestSettingsFramePasswords) {
668 std::string url(chrome::kChromeUISettingsFrameURL);
669 url += "passwords";
670 RunBidiCheckerOnPage(url);
673 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
674 TestSettingsFramePasswords) {
675 std::string url(chrome::kChromeUISettingsFrameURL);
676 url += "passwords";
677 RunBidiCheckerOnPage(url);
680 //========================================
681 // chrome://settings-frame/fonts
682 //========================================
684 #if defined(OS_MACOSX)
685 #define MAYBE_TestSettingsFrameFonts DISABLED_TestSettingsFrameFonts
686 #else
687 #define MAYBE_TestSettingsFrameFonts TestSettingsFrameFonts
688 #endif
689 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR,
690 MAYBE_TestSettingsFrameFonts) {
691 std::string url(chrome::kChromeUISettingsFrameURL);
692 url += "fonts";
693 RunBidiCheckerOnPage(url);
696 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
697 TestSettingsFrameFonts) {
698 std::string url(chrome::kChromeUISettingsFrameURL);
699 url += "fonts";
700 RunBidiCheckerOnPage(url);
703 // Test other uber iframes.
705 //==============================
706 // chrome://extensions-frame
707 //==============================
709 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestExtensionsFrame) {
710 RunBidiCheckerOnPage(chrome::kChromeUIExtensionsFrameURL);
713 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL,
714 TestExtensionsFrame) {
715 RunBidiCheckerOnPage(chrome::kChromeUIExtensionsFrameURL);
718 //==============================
719 // chrome://help-frame
720 //==============================
722 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestHelpFrame) {
723 RunBidiCheckerOnPage(chrome::kChromeUIHelpFrameURL);
726 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHelpFrame) {
727 RunBidiCheckerOnPage(chrome::kChromeUIHelpFrameURL);
730 //==============================
731 // chrome://history-frame
732 //==============================
734 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestHistoryFrame) {
735 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL);
738 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestHistoryFrame) {
739 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL);