Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 |
|
jeremy
2011/10/30 13:08:56
nit: . at end of comment.
ofri1
2011/11/06 10:10:11
Done.
| |
| 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 |
| 138 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestDownloadsPageLTR) { | 154 //============================== |
| 139 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL, false); | 155 // chrome://crashes |
| 156 //============================== | |
| 157 | |
| 158 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestCrashesPage) { | |
| 159 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL); | |
| 140 } | 160 } |
| 141 | 161 |
| 142 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 162 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestCrashesPage) { |
| 143 TestDownloadsPageRTL) { | 163 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL); |
| 144 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage( | |
| 145 chrome::kChromeUIDownloadsURL, true); | |
| 146 } | 164 } |
| 147 | 165 |
| 148 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestNewTabPageLTR) { | 166 //============================== |
| 149 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL, false); | 167 // chrome://downloads |
| 168 //============================== | |
| 169 | |
| 170 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestDownloadsPage) { | |
| 171 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL); | |
| 172 } | |
| 173 | |
| 174 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestDownloadsPage) { | |
| 175 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL); | |
| 176 } | |
| 177 | |
| 178 //============================== | |
| 179 // chrome://newtab | |
| 180 //============================== | |
| 181 | |
| 182 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestNewTabPage) { | |
| 183 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL); | |
| 150 } | 184 } |
| 151 | 185 |
| 152 // http://crbug.com/97453 | 186 // http://crbug.com/97453 |
| 153 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 187 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, |
| 154 DISABLED_TestNewTabPageRTL) { | 188 DISABLED_TestNewTabPage) { |
| 155 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUINewTabURL, | 189 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL); |
| 156 true); | |
| 157 } | 190 } |
| 158 | 191 |
| 159 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestPluginsPageLTR) { | 192 //============================== |
| 160 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL, false); | 193 // chrome://plugins |
| 194 //============================== | |
| 195 | |
| 196 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestPluginsPage) { | |
| 197 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL); | |
| 161 } | 198 } |
| 162 | 199 |
| 163 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 200 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestPluginsPage) { |
| 164 TestPluginsPageRTL) { | 201 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL); |
| 165 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL, | |
| 166 true); | |
| 167 } | 202 } |
| 168 | 203 |
| 169 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestSettingsPageLTR) { | 204 //============================== |
| 170 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL, false); | 205 // chrome://settings |
| 206 //============================== | |
| 207 | |
| 208 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestSettingsPage) { | |
| 209 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL); | |
| 171 } | 210 } |
| 172 | 211 |
| 173 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 212 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestSettingsPage) { |
| 174 TestSettingsPageRTL) { | 213 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL); |
| 175 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage( | |
| 176 chrome::kChromeUISettingsURL, true); | |
| 177 } | 214 } |
| 178 | 215 |
| 179 #if defined(OS_MACOSX) | 216 #if defined(OS_MACOSX) |
| 180 // http://crbug.com/94642 | 217 // http://crbug.com/94642 |
| 181 #define MAYBE_TestSettingsAutofillPageLTR FLAKY_TestSettingsAutofillPageLTR | 218 #define MAYBE_TestSettingsAutofillPage FLAKY_TestSettingsAutofillPage |
| 182 #elif defined(OS_WIN) | 219 #elif defined(OS_WIN) |
| 183 // http://crbug.com/95425 | 220 // http://crbug.com/95425 |
| 184 #define MAYBE_TestSettingsAutofillPageLTR FAILS_TestSettingsAutofillPageLTR | 221 #define MAYBE_TestSettingsAutofillPage FAILS_TestSettingsAutofillPage |
| 185 #else | 222 #else |
| 186 #define MAYBE_TestSettingsAutofillPageLTR TestSettingsAutofillPageLTR | 223 #define MAYBE_TestSettingsAutofillPage TestSettingsAutofillPage |
| 187 #endif // defined(OS_MACOSX) | 224 #endif // defined(OS_MACOSX) |
| 188 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, | 225 |
| 189 MAYBE_TestSettingsAutofillPageLTR) { | 226 static void SetupSettingsAutofillPageTest(Profile* profile, |
| 227 const char* first_name, | |
| 228 const char* middle_name, | |
| 229 const char* last_name, | |
| 230 const char* email, | |
| 231 const char* company, | |
| 232 const char* address1, | |
| 233 const char* address2, | |
| 234 const char* city, | |
| 235 const char* state, | |
| 236 const char* zipcode, | |
| 237 const char* country, | |
| 238 const char* phone) { | |
| 239 autofill_test::DisableSystemServices(profile); | |
| 240 AutofillProfile autofill_profile; | |
| 241 autofill_test::SetProfileInfo(&autofill_profile, | |
| 242 first_name, | |
| 243 middle_name, | |
| 244 last_name, | |
| 245 email, | |
| 246 company, | |
| 247 address1, | |
| 248 address2, | |
| 249 city, | |
| 250 state, | |
| 251 zipcode, | |
| 252 country, | |
| 253 phone); | |
| 254 PersonalDataManager* personal_data_manager = | |
| 255 PersonalDataManagerFactory::GetForProfile(profile); | |
| 256 ASSERT_TRUE(personal_data_manager); | |
| 257 personal_data_manager->AddProfile(autofill_profile); | |
| 258 } | |
| 259 | |
| 260 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 261 TestSettingsAutofillPage) { | |
| 262 SetupSettingsAutofillPageTest(browser()->profile(), | |
| 263 "\xD7\x9E\xD7\xA9\xD7\x94", | |
| 264 "\xD7\x91", | |
| 265 "\xD7\x9B\xD7\x94\xD7\x9F", | |
| 266 "moshe.b.cohen@biditest.com", | |
| 267 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x20" | |
| 268 "\xD7\x91\xD7\xA2\xD7\x9E", | |
| 269 "\xD7\x93\xD7\xA8\xD7\x9A\x20\xD7\x9E\xD7\xA0" | |
| 270 "\xD7\x97\xD7\x9D\x20\xD7\x91\xD7\x92\xD7" | |
| 271 "\x99\xD7\x9F\x20\x32\x33", | |
| 272 "\xD7\xA7\xD7\x95\xD7\x9E\xD7\x94\x20\x32\x36", | |
| 273 "\xD7\xAA\xD7\x9C\x20\xD7\x90\xD7\x91\xD7\x99" | |
| 274 "\xD7\x91", | |
| 275 "", | |
| 276 "66183", | |
| 277 "\xD7\x99\xD7\xA9\xD7\xA8\xD7\x90\xD7\x9C", | |
| 278 "0000"); | |
| 190 std::string url(chrome::kChromeUISettingsURL); | 279 std::string url(chrome::kChromeUISettingsURL); |
| 191 url += std::string(chrome::kAutofillSubPage); | 280 url += std::string(chrome::kAutofillSubPage); |
| 192 | 281 RunBidiCheckerOnPage(url.c_str()); |
| 193 autofill_test::DisableSystemServices(browser()->profile()); | |
| 194 AutofillProfile profile; | |
| 195 autofill_test::SetProfileInfo( | |
| 196 &profile, | |
| 197 "\xD7\x9E\xD7\xA9\xD7\x94", | |
| 198 "\xD7\x91", | |
| 199 "\xD7\x9B\xD7\x94\xD7\x9F", | |
| 200 "moshe.b.cohen@biditest.com", | |
| 201 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x20\xD7\x91\xD7\xA2\xD7\x9E", | |
| 202 "\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", | |
| 203 "\xD7\xA7\xD7\x95\xD7\x9E\xD7\x94\x20\x32\x36", | |
| 204 "\xD7\xAA\xD7\x9C\x20\xD7\x90\xD7\x91\xD7\x99\xD7\x91", | |
| 205 "", | |
| 206 "66183", | |
| 207 "\xD7\x99\xD7\xA9\xD7\xA8\xD7\x90\xD7\x9C", | |
| 208 "0000"); | |
| 209 | |
| 210 PersonalDataManager* personal_data_manager = | |
| 211 PersonalDataManagerFactory::GetForProfile(browser()->profile()); | |
| 212 ASSERT_TRUE(personal_data_manager); | |
| 213 | |
| 214 personal_data_manager->AddProfile(profile); | |
| 215 | |
| 216 RunBidiCheckerOnPage(url.c_str(), false); | |
| 217 } | 282 } |
| 218 | 283 |
| 219 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 284 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, |
| 220 TestSettingsAutofillPageRTL) { | 285 TestSettingsAutofillPage) { |
| 221 std::string url(chrome::kChromeUISettingsURL); | 286 SetupSettingsAutofillPageTest(browser()->profile(), |
| 222 url += std::string(chrome::kAutofillSubPage); | |
| 223 | |
| 224 autofill_test::DisableSystemServices(browser()->profile()); | |
| 225 AutofillProfile profile; | |
| 226 autofill_test::SetProfileInfo( | |
| 227 &profile, | |
| 228 "Milton", | 287 "Milton", |
| 229 "C.", | 288 "C.", |
| 230 "Waddams", | 289 "Waddams", |
| 231 "red.swingline@initech.com", | 290 "red.swingline@initech.com", |
| 232 "Initech", | 291 "Initech", |
| 233 "4120 Freidrich Lane", | 292 "4120 Freidrich Lane", |
| 234 "Basement", | 293 "Basement", |
| 235 "Austin", | 294 "Austin", |
| 236 "Texas", | 295 "Texas", |
| 237 "78744", | 296 "78744", |
| 238 "United States", | 297 "United States", |
| 239 "5125551234"); | 298 "5125551234"); |
| 299 std::string url(chrome::kChromeUISettingsURL); | |
| 300 url += std::string(chrome::kAutofillSubPage); | |
| 301 RunBidiCheckerOnPage(url.c_str()); | |
| 302 } | |
| 240 | 303 |
| 241 PersonalDataManager* personal_data_manager = | 304 static void SetupSettingsBrowserOptionsTest(Profile* profile, |
| 242 PersonalDataManagerFactory::GetForProfile(browser()->profile()); | 305 const GURL url, |
| 243 ASSERT_TRUE(personal_data_manager); | 306 const std::string title) { |
| 307 // First, add a history entry for the site. This is needed so the site's | |
| 308 // name will appear in the startup sites lists. | |
| 309 HistoryService* history_service = | |
| 310 profile->GetHistoryService(Profile::IMPLICIT_ACCESS); | |
| 311 history_service->AddPage(url, history::SOURCE_BROWSED); | |
| 312 history_service->SetPageTitle(url, UTF8ToUTF16(title)); | |
| 313 // Next, add the site to the startup sites | |
| 314 PrefService* prefs = profile->GetPrefs(); | |
| 315 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); | |
| 316 pref.urls.push_back(url); | |
| 317 SessionStartupPref::SetStartupPref(prefs, pref); | |
| 318 } | |
| 244 | 319 |
| 245 personal_data_manager->AddProfile(profile); | 320 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, |
| 321 TestSettingsBrowserOptionsPage) { | |
| 322 SetupSettingsBrowserOptionsTest(browser()->profile(), | |
| 323 GURL("http://ynet.co.il"), | |
| 324 "\x79\x6E\x65\x74\x20\xD7\x97\xD7\x93\xD7\xA9" | |
|
jeremy
2011/10/30 13:08:56
>80 chars ?
ofri1
2011/11/06 10:10:11
It's exactly 80 but broke it down more anyhow.
| |
| 325 "\xD7\x95\xD7\xAA\x20\xD7\xAA\xD7\x95\xD7\x9B" | |
| 326 "\xD7\x9F\x20\xD7\x95\xD7\xA2\xD7\x93\xD7\x9B" | |
| 327 "\xD7\x95\xD7\xA0\xD7\x99\xD7\x9D\x20\x2D\x20" | |
| 328 "\xD7\x99\xD7\x93\xD7\x99\xD7\xA2\xD7\x95\xD7" | |
| 329 "\xAA\x20\xD7\x90\xD7\x97\xD7\xA8\xD7\x95\xD7" | |
| 330 "\xA0\xD7\x95\xD7\xAA"); | |
| 331 std::string url(chrome::kChromeUISettingsURL); | |
| 332 url += std::string(chrome::kBrowserOptionsSubPage); | |
| 333 RunBidiCheckerOnPage(url.c_str()); | |
| 334 } | |
| 246 | 335 |
| 247 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(url.c_str(), true); | 336 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, |
| 337 TestSettingsBrowserOptionsPage) { | |
| 338 SetupSettingsBrowserOptionsTest(browser()->profile(), | |
| 339 GURL("http://google.com"), | |
| 340 "Google"); | |
| 341 std::string url(chrome::kChromeUISettingsURL); | |
| 342 url += std::string(chrome::kBrowserOptionsSubPage); | |
| 343 RunBidiCheckerOnPage(url.c_str()); | |
| 248 } | 344 } |
| 345 | |
| 346 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 347 TestSettingsClearBrowserDataPage) { | |
| 348 std::string url(chrome::kChromeUISettingsURL); | |
| 349 url += std::string(chrome::kClearBrowserDataSubPage); | |
| 350 RunBidiCheckerOnPage(url.c_str()); | |
| 351 } | |
| 352 | |
| 353 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 354 TestSettingsClearBrowserDataPage) { | |
| 355 std::string url(chrome::kChromeUISettingsURL); | |
| 356 url += std::string(chrome::kClearBrowserDataSubPage); | |
| 357 RunBidiCheckerOnPage(url.c_str()); | |
| 358 } | |
| 359 | |
| 360 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 361 TestSettingsContentSettingsPage) { | |
| 362 std::string url(chrome::kChromeUISettingsURL); | |
| 363 url += std::string(chrome::kContentSettingsSubPage); | |
| 364 RunBidiCheckerOnPage(url.c_str()); | |
| 365 } | |
| 366 | |
| 367 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 368 TestSettingsContentSettingsPage) { | |
| 369 std::string url(chrome::kChromeUISettingsURL); | |
| 370 url += std::string(chrome::kContentSettingsSubPage); | |
| 371 RunBidiCheckerOnPage(url.c_str()); | |
| 372 } | |
| 373 | |
| 374 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 375 TestSettingsContentSettingsExceptionsPage) { | |
| 376 std::string url(chrome::kChromeUISettingsURL); | |
| 377 url += std::string(chrome::kContentSettingsExceptionsSubPage); | |
| 378 RunBidiCheckerOnPage(url.c_str()); | |
| 379 } | |
| 380 | |
| 381 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 382 TestSettingsContentSettingsExceptionsPage) { | |
| 383 std::string url(chrome::kChromeUISettingsURL); | |
| 384 url += std::string(chrome::kContentSettingsExceptionsSubPage); | |
| 385 RunBidiCheckerOnPage(url.c_str()); | |
| 386 } | |
| 387 | |
| 388 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 389 TestSettingsLanguageOptionsPage) { | |
| 390 std::string url(chrome::kChromeUISettingsURL); | |
| 391 url += std::string(chrome::kLanguageOptionsSubPage); | |
| 392 RunBidiCheckerOnPage(url.c_str()); | |
| 393 } | |
| 394 | |
| 395 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 396 TestSettingsLanguageOptionsPage) { | |
| 397 std::string url(chrome::kChromeUISettingsURL); | |
| 398 url += std::string(chrome::kLanguageOptionsSubPage); | |
| 399 RunBidiCheckerOnPage(url.c_str()); | |
| 400 } | |
| 401 | |
| 402 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 403 TestSettingsSearchEnginesOptionsPage) { | |
| 404 std::string url(chrome::kChromeUISettingsURL); | |
| 405 url += std::string(chrome::kSearchEnginesSubPage); | |
| 406 RunBidiCheckerOnPage(url.c_str()); | |
| 407 } | |
| 408 | |
| 409 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 410 TestSettingsSearchEnginesOptionsPage) { | |
| 411 std::string url(chrome::kChromeUISettingsURL); | |
| 412 url += std::string(chrome::kSearchEnginesSubPage); | |
| 413 RunBidiCheckerOnPage(url.c_str()); | |
| 414 } | |
| OLD | NEW |