OLD | NEW |
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" |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 | 137 |
138 base::i18n::SetICUDefaultLocale(app_locale_); | 138 base::i18n::SetICUDefaultLocale(app_locale_); |
139 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest( | 139 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest( |
140 base::FilePath()); | 140 base::FilePath()); |
141 ReloadLocaleResources(app_locale_); | 141 ReloadLocaleResources(app_locale_); |
142 } | 142 } |
143 | 143 |
144 // Tests | 144 // Tests |
145 | 145 |
146 //============================== | 146 //============================== |
147 // chrome://settings/history | 147 // chrome://history |
148 //============================== | 148 //============================== |
149 | 149 |
150 static void SetupHistoryPageTest(Browser* browser, | 150 static void SetupHistoryPageTest(Browser* browser, |
151 const std::string& page_url, | 151 const std::string& page_url, |
152 const std::string& page_title) { | 152 const std::string& page_title) { |
153 history::HistoryService* history_service = | 153 history::HistoryService* history_service = |
154 HistoryServiceFactory::GetForProfile(browser->profile(), | 154 HistoryServiceFactory::GetForProfile(browser->profile(), |
155 ServiceAccessType::IMPLICIT_ACCESS); | 155 ServiceAccessType::IMPLICIT_ACCESS); |
156 const GURL history_url = GURL(page_url); | 156 const GURL history_url = GURL(page_url); |
157 history_service->AddPage( | 157 history_service->AddPage( |
158 history_url, base::Time::Now(), history::SOURCE_BROWSED); | 158 history_url, base::Time::Now(), history::SOURCE_BROWSED); |
159 history_service->SetPageTitle(history_url, base::UTF8ToUTF16(page_title)); | 159 history_service->SetPageTitle(history_url, base::UTF8ToUTF16(page_title)); |
160 } | 160 } |
161 | 161 |
162 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestLTR, | 162 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestLTR, |
163 TestHistoryPage) { | 163 TestHistoryPage) { |
164 // Test an Israeli news site with a Hebrew title. | 164 // Test an Israeli news site with a Hebrew title. |
165 SetupHistoryPageTest(browser(), | 165 SetupHistoryPageTest(browser(), |
166 "http://www.ynet.co.il", | 166 "http://www.ynet.co.il", |
167 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21"); | 167 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21"); |
168 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); | 168 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL); |
169 } | 169 } |
170 | 170 |
171 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestRTL, | 171 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestRTL, |
172 TestHistoryPage) { | 172 TestHistoryPage) { |
173 SetupHistoryPageTest(browser(), "http://www.google.com", "Google"); | 173 SetupHistoryPageTest(browser(), "http://www.google.com", "Google"); |
174 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); | 174 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL); |
175 } | 175 } |
176 | 176 |
177 //============================== | 177 //============================== |
178 // chrome://about | 178 // chrome://about |
179 //============================== | 179 //============================== |
180 | 180 |
181 // This page isn't localized to an RTL language so we test it only in English. | 181 // This page isn't localized to an RTL language so we test it only in English. |
182 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestLTR, TestAboutPage) { | 182 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestLTR, TestAboutPage) { |
183 RunBidiCheckerOnPage(chrome::kChromeUIAboutURL); | 183 RunBidiCheckerOnPage(chrome::kChromeUIAboutURL); |
184 } | 184 } |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 // chrome://help-frame | 717 // chrome://help-frame |
718 //============================== | 718 //============================== |
719 | 719 |
720 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestLTR, TestHelpFrame) { | 720 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestLTR, TestHelpFrame) { |
721 RunBidiCheckerOnPage(chrome::kChromeUIHelpFrameURL); | 721 RunBidiCheckerOnPage(chrome::kChromeUIHelpFrameURL); |
722 } | 722 } |
723 | 723 |
724 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestRTL, TestHelpFrame) { | 724 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestRTL, TestHelpFrame) { |
725 RunBidiCheckerOnPage(chrome::kChromeUIHelpFrameURL); | 725 RunBidiCheckerOnPage(chrome::kChromeUIHelpFrameURL); |
726 } | 726 } |
727 | |
728 //============================== | |
729 // chrome://history-frame | |
730 //============================== | |
731 | |
732 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestLTR, | |
733 TestHistoryFrame) { | |
734 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); | |
735 } | |
736 | |
737 IN_PROC_BROWSER_TEST_F(DISABLED_WebUIBidiCheckerBrowserTestRTL, | |
738 TestHistoryFrame) { | |
739 RunBidiCheckerOnPage(chrome::kChromeUIHistoryFrameURL); | |
740 } | |
OLD | NEW |