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. |
|
jeremy
2011/10/25 09:19:53
General comments for the tests in this file:
* Ple
ofri1
2011/10/30 09:42:40
Done.
| |
| 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 |
| 62 // WebUIBidiCheckerBrowserTestLTR | |
| 63 | |
| 64 void WebUIBidiCheckerBrowserTestLTR::RunBidiCheckerOnPage( | |
| 65 const char pageURL[]) { | |
| 66 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(pageURL, false); | |
| 67 } | |
| 68 | |
| 60 // WebUIBidiCheckerBrowserTestFakeBidi | 69 // WebUIBidiCheckerBrowserTestFakeBidi |
|
jeremy
2011/10/25 09:19:53
I think you can remove this and the above comment.
ofri1
2011/10/30 09:42:40
Done.
| |
| 61 | 70 |
| 62 WebUIBidiCheckerBrowserTestFakeBidi::~WebUIBidiCheckerBrowserTestFakeBidi() {} | 71 void WebUIBidiCheckerBrowserTestRTL::RunBidiCheckerOnPage( |
| 72 const char pageURL[]) { | |
| 73 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(pageURL, true); | |
| 74 } | |
| 63 | 75 |
| 64 WebUIBidiCheckerBrowserTestFakeBidi::WebUIBidiCheckerBrowserTestFakeBidi() {} | 76 void WebUIBidiCheckerBrowserTestRTL::SetUpOnMainThread() { |
| 65 | |
| 66 void WebUIBidiCheckerBrowserTestFakeBidi::SetUpOnMainThread() { | |
| 67 WebUIBidiCheckerBrowserTest::SetUpOnMainThread(); | 77 WebUIBidiCheckerBrowserTest::SetUpOnMainThread(); |
| 68 FilePath pak_path; | 78 FilePath pak_path; |
| 69 app_locale_ = base::i18n::GetConfiguredLocale(); | 79 app_locale_ = base::i18n::GetConfiguredLocale(); |
| 70 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path)); | 80 ASSERT_TRUE(PathService::Get(base::FILE_MODULE, &pak_path)); |
| 71 pak_path = pak_path.DirName(); | 81 pak_path = pak_path.DirName(); |
| 72 pak_path = pak_path.AppendASCII("pseudo_locales"); | 82 pak_path = pak_path.AppendASCII("pseudo_locales"); |
| 73 pak_path = pak_path.AppendASCII("fake-bidi"); | 83 pak_path = pak_path.AppendASCII("fake-bidi"); |
| 74 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak")); | 84 pak_path = pak_path.ReplaceExtension(FILE_PATH_LITERAL("pak")); |
| 75 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path); | 85 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(pak_path); |
| 76 ResourceBundle::ReloadSharedInstance("he"); | 86 ResourceBundle::ReloadSharedInstance("he"); |
| 77 base::i18n::SetICUDefaultLocale("he"); | 87 base::i18n::SetICUDefaultLocale("he"); |
| 78 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) | 88 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) |
| 79 gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL); | 89 gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL); |
| 80 #endif | 90 #endif |
| 81 } | 91 } |
| 82 | 92 |
| 83 void WebUIBidiCheckerBrowserTestFakeBidi::CleanUpOnMainThread() { | 93 void WebUIBidiCheckerBrowserTestRTL::CleanUpOnMainThread() { |
| 84 WebUIBidiCheckerBrowserTest::CleanUpOnMainThread(); | 94 WebUIBidiCheckerBrowserTest::CleanUpOnMainThread(); |
| 85 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) | 95 #if defined(OS_POSIX) && defined(TOOLKIT_USES_GTK) |
| 86 gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR); | 96 gtk_widget_set_default_direction(GTK_TEXT_DIR_LTR); |
| 87 #endif | 97 #endif |
| 88 base::i18n::SetICUDefaultLocale(app_locale_); | 98 base::i18n::SetICUDefaultLocale(app_locale_); |
| 89 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(FilePath()); | 99 ResourceBundle::GetSharedInstance().OverrideLocalePakForTest(FilePath()); |
| 90 ResourceBundle::ReloadSharedInstance(app_locale_); | 100 ResourceBundle::ReloadSharedInstance(app_locale_); |
| 91 } | 101 } |
| 92 | 102 |
| 93 // Tests | 103 // Tests |
| 94 | 104 |
| 95 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestMainHistoryPageLTR) { | 105 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestMainHistoryPage) { |
| 96 HistoryService* history_service = | 106 HistoryService* history_service = |
| 97 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); | 107 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); |
|
jeremy
2011/10/25 09:19:53
Can you split the setup code out into a common fun
ofri1
2011/10/30 09:42:40
Done.
| |
| 98 GURL history_url = GURL("http://www.ynet.co.il"); | 108 const GURL history_url = GURL("http://www.ynet.co.il"); |
| 99 history_service->AddPage(history_url, history::SOURCE_BROWSED); | 109 history_service->AddPage(history_url, history::SOURCE_BROWSED); |
| 100 string16 title; | 110 string16 title; |
| 101 ASSERT_TRUE(UTF8ToUTF16("\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21", | 111 ASSERT_TRUE(UTF8ToUTF16("\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x21", |
| 102 12, | 112 12, |
|
jeremy
2011/10/25 09:19:53
Why can't you use the single argument version of U
ofri1
2011/10/30 09:42:40
Done.
| |
| 103 &title)); | 113 &title)); |
| 104 history_service->SetPageTitle(history_url, title); | 114 history_service->SetPageTitle(history_url, title); |
| 105 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL, false); | 115 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL); |
| 106 } | 116 } |
| 107 | 117 |
| 108 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 118 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestMainHistoryPage) { |
| 109 TestMainHistoryPageRTL) { | |
| 110 HistoryService* history_service = | 119 HistoryService* history_service = |
| 111 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); | 120 browser()->profile()->GetHistoryService(Profile::IMPLICIT_ACCESS); |
| 112 GURL history_url = GURL("http://www.google.com"); | 121 const GURL history_url = GURL("http://www.google.com"); |
| 113 history_service->AddPage(history_url, history::SOURCE_BROWSED); | 122 history_service->AddPage(history_url, history::SOURCE_BROWSED); |
| 114 string16 title = UTF8ToUTF16("Google"); | 123 string16 title = UTF8ToUTF16("Google"); |
| 115 history_service->SetPageTitle(history_url, title); | 124 history_service->SetPageTitle(history_url, title); |
| 116 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL, | 125 RunBidiCheckerOnPage(chrome::kChromeUIHistoryURL); |
| 117 true); | |
| 118 } | 126 } |
| 119 | 127 |
| 120 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestAboutPageLTR) { | 128 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestAboutPage) { |
| 121 RunBidiCheckerOnPage(chrome::kChromeUIAboutURL, false); | 129 RunBidiCheckerOnPage(chrome::kChromeUIAboutURL); |
| 122 } | 130 } |
| 123 | 131 |
| 124 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestBugReportPageLTR) { | 132 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestBugReportPage) { |
| 125 RunBidiCheckerOnPage(chrome::kChromeUIBugReportURL, false); | 133 // The bugreport page receives its contents as GET arguments. Here we provide |
| 134 // a custom, Hebrew typed, description message. | |
| 135 RunBidiCheckerOnPage( | |
| 136 "chrome://bugreport#0?description=%D7%91%D7%93%D7%99%D7%A7%D7%94&issueType =1"); | |
|
jeremy
2011/10/25 09:19:53
"foo"
"bar"
ofri1
2011/10/30 09:42:40
Done.
| |
| 126 } | 137 } |
| 127 | 138 |
| 128 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestCrashesPageLTR) { | 139 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, |
| 129 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL, false); | 140 TestBugReportPage) { |
| 141 RunBidiCheckerOnPage("chrome://bugreport#0?description=test&issueType=1"); | |
| 130 } | 142 } |
| 131 | 143 |
| 132 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 144 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestCrashesPage) { |
| 133 TestCrashesPageRTL) { | 145 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL); |
| 134 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUICrashesURL, | |
| 135 true); | |
| 136 } | 146 } |
| 137 | 147 |
| 138 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestDownloadsPageLTR) { | 148 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestCrashesPage) { |
| 139 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL, false); | 149 RunBidiCheckerOnPage(chrome::kChromeUICrashesURL); |
| 140 } | 150 } |
| 141 | 151 |
| 142 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 152 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestDownloadsPage) { |
| 143 TestDownloadsPageRTL) { | 153 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL); |
| 144 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage( | |
| 145 chrome::kChromeUIDownloadsURL, true); | |
| 146 } | 154 } |
| 147 | 155 |
| 148 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestNewTabPageLTR) { | 156 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestDownloadsPage) { |
| 149 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL, false); | 157 RunBidiCheckerOnPage(chrome::kChromeUIDownloadsURL); |
| 158 } | |
| 159 | |
| 160 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestNewTabPage) { | |
| 161 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL); | |
| 150 } | 162 } |
| 151 | 163 |
| 152 // http://crbug.com/97453 | 164 // http://crbug.com/97453 |
| 153 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 165 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, |
| 154 DISABLED_TestNewTabPageRTL) { | 166 DISABLED_TestNewTabPage) { |
| 155 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUINewTabURL, | 167 RunBidiCheckerOnPage(chrome::kChromeUINewTabURL); |
| 156 true); | |
| 157 } | 168 } |
| 158 | 169 |
| 159 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestPluginsPageLTR) { | 170 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestPluginsPage) { |
| 160 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL, false); | 171 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL); |
| 161 } | 172 } |
| 162 | 173 |
| 163 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 174 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestPluginsPage) { |
| 164 TestPluginsPageRTL) { | 175 RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL); |
| 165 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(chrome::kChromeUIPluginsURL, | |
| 166 true); | |
| 167 } | 176 } |
| 168 | 177 |
| 169 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, TestSettingsPageLTR) { | 178 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, TestSettingsPage) { |
| 170 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL, false); | 179 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL); |
| 171 } | 180 } |
| 172 | 181 |
| 173 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 182 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, TestSettingsPage) { |
| 174 TestSettingsPageRTL) { | 183 RunBidiCheckerOnPage(chrome::kChromeUISettingsURL); |
| 175 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage( | |
| 176 chrome::kChromeUISettingsURL, true); | |
| 177 } | 184 } |
| 178 | 185 |
| 179 #if defined(OS_MACOSX) | 186 #if defined(OS_MACOSX) |
| 180 // http://crbug.com/94642 | 187 // http://crbug.com/94642 |
|
jeremy
2011/10/25 09:19:53
Any updates on this bug?
ofri1
2011/10/30 09:42:40
Checking.
| |
| 181 #define MAYBE_TestSettingsAutofillPageLTR FLAKY_TestSettingsAutofillPageLTR | 188 #define MAYBE_TestSettingsAutofillPage FLAKY_TestSettingsAutofillPage |
| 182 #elif defined(OS_WIN) | 189 #elif defined(OS_WIN) |
| 183 // http://crbug.com/95425 | 190 // http://crbug.com/95425 |
| 184 #define MAYBE_TestSettingsAutofillPageLTR FAILS_TestSettingsAutofillPageLTR | 191 #define MAYBE_TestSettingsAutofillPage FAILS_TestSettingsAutofillPage |
| 185 #else | 192 #else |
| 186 #define MAYBE_TestSettingsAutofillPageLTR TestSettingsAutofillPageLTR | 193 #define MAYBE_TestSettingsAutofillPage TestSettingsAutofillPage |
| 187 #endif // defined(OS_MACOSX) | 194 #endif // defined(OS_MACOSX) |
| 188 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTest, | 195 |
| 189 MAYBE_TestSettingsAutofillPageLTR) { | 196 static void SetupTestSettingsAutofillPage(Profile* profile, |
| 197 const char* first_name, | |
| 198 const char* middle_name, | |
| 199 const char* last_name, | |
| 200 const char* email, | |
| 201 const char* company, | |
| 202 const char* address1, | |
| 203 const char* address2, | |
| 204 const char* city, | |
| 205 const char* state, | |
| 206 const char* zipcode, | |
| 207 const char* country, | |
| 208 const char* phone) { | |
| 209 autofill_test::DisableSystemServices(profile); | |
| 210 AutofillProfile autofill_profile; | |
| 211 autofill_test::SetProfileInfo(&autofill_profile, | |
| 212 first_name, | |
| 213 middle_name, | |
| 214 last_name, | |
| 215 email, | |
| 216 company, | |
| 217 address1, | |
| 218 address2, | |
| 219 city, | |
| 220 state, | |
| 221 zipcode, | |
| 222 country, | |
| 223 phone); | |
| 224 PersonalDataManager* personal_data_manager = | |
| 225 PersonalDataManagerFactory::GetForProfile(profile); | |
|
jeremy
2011/10/25 09:19:53
indent
ofri1
2011/10/30 09:42:40
Done.
| |
| 226 ASSERT_TRUE(personal_data_manager); | |
| 227 personal_data_manager->AddProfile(autofill_profile); | |
| 228 } | |
| 229 | |
| 230 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 231 MAYBE_TestSettingsAutofillPage) { | |
| 232 SetupTestSettingsAutofillPage(browser()->profile(), | |
| 233 "\xD7\x9E\xD7\xA9\xD7\x94", | |
| 234 "\xD7\x91", | |
| 235 "\xD7\x9B\xD7\x94\xD7\x9F", | |
| 236 "moshe.b.cohen@biditest.com", | |
| 237 "\xD7\x91\xD7\x93\xD7\x99\xD7\xA7\xD7\x94\x20\xD 7\x91\xD7\xA2\xD7\x9E", | |
|
jeremy
2011/10/25 09:19:53
>80 chars, use string continuation, also bellow.
ofri1
2011/10/30 09:42:40
Done.
| |
| 238 "\xD7\x93\xD7\xA8\xD7\x9A\x20\xD7\x9E\xD7\xA0\xD 7\x97\xD7\x9D\x20\xD7\x91\xD7\x92\xD7\x99\xD7\x9F\x20\x32\x33", | |
| 239 "\xD7\xA7\xD7\x95\xD7\x9E\xD7\x94\x20\x32\x36", | |
| 240 "\xD7\xAA\xD7\x9C\x20\xD7\x90\xD7\x91\xD7\x99\xD 7\x91", | |
| 241 "", | |
| 242 "66183", | |
| 243 "\xD7\x99\xD7\xA9\xD7\xA8\xD7\x90\xD7\x9C", | |
| 244 "0000"); | |
| 190 std::string url(chrome::kChromeUISettingsURL); | 245 std::string url(chrome::kChromeUISettingsURL); |
| 191 url += std::string(chrome::kAutofillSubPage); | 246 url += std::string(chrome::kAutofillSubPage); |
| 192 | 247 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 } | 248 } |
| 218 | 249 |
| 219 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestFakeBidi, | 250 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, |
| 220 TestSettingsAutofillPageRTL) { | 251 TestSettingsAutofillPage) { |
|
jeremy
2011/10/25 09:19:53
MAYBE_Test... ?
ofri1
2011/10/30 09:42:40
No problem with the RTL version
| |
| 221 std::string url(chrome::kChromeUISettingsURL); | 252 SetupTestSettingsAutofillPage(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", | 253 "Milton", |
| 229 "C.", | 254 "C.", |
| 230 "Waddams", | 255 "Waddams", |
| 231 "red.swingline@initech.com", | 256 "red.swingline@initech.com", |
| 232 "Initech", | 257 "Initech", |
| 233 "4120 Freidrich Lane", | 258 "4120 Freidrich Lane", |
| 234 "Basement", | 259 "Basement", |
| 235 "Austin", | 260 "Austin", |
| 236 "Texas", | 261 "Texas", |
| 237 "78744", | 262 "78744", |
| 238 "United States", | 263 "United States", |
| 239 "5125551234"); | 264 "5125551234"); |
| 265 std::string url(chrome::kChromeUISettingsURL); | |
| 266 url += std::string(chrome::kAutofillSubPage); | |
| 267 RunBidiCheckerOnPage(url.c_str()); | |
| 268 } | |
| 240 | 269 |
| 241 PersonalDataManager* personal_data_manager = | 270 static void SetupTestSettingsBrowserOptions(Profile* profile, |
| 242 PersonalDataManagerFactory::GetForProfile(browser()->profile()); | 271 const GURL url, |
| 243 ASSERT_TRUE(personal_data_manager); | 272 const std::string title) { |
| 273 // First, add a history entry for the site. This is needed so the site's | |
| 274 // name will appear in the startup sites lists. | |
| 275 HistoryService* history_service = | |
| 276 profile->GetHistoryService(Profile::IMPLICIT_ACCESS); | |
| 277 history_service->AddPage(url, history::SOURCE_BROWSED); | |
| 278 history_service->SetPageTitle(url, UTF8ToUTF16(title)); | |
| 279 // Next, add the site to the startup sites | |
| 280 PrefService* prefs = profile->GetPrefs(); | |
| 281 SessionStartupPref pref = SessionStartupPref::GetStartupPref(prefs); | |
| 282 pref.urls.push_back(url); | |
| 283 SessionStartupPref::SetStartupPref(prefs, pref); | |
| 284 } | |
| 244 | 285 |
| 245 personal_data_manager->AddProfile(profile); | 286 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, |
| 287 TestSettingsBorwserOptionsPage) { | |
|
jeremy
2011/10/25 09:19:53
*Browser
ofri1
2011/10/30 09:42:40
Done.
| |
| 288 SetupTestSettingsBrowserOptions(browser()->profile(), | |
| 289 GURL("http://ynet.co.il"), | |
| 290 "\x79\x6E\x65\x74\x20\xD7\x97\xD7\x93\xD7\xA9\ xD7\x95" | |
| 291 "\xD7\xAA\x20\xD7\xAA\xD7\x95\xD7\x9B\xD7\x9F\ x20\xD7" | |
| 292 "\x95\xD7\xA2\xD7\x93\xD7\x9B\xD7\x95\xD7\xA0\ xD7\x99" | |
| 293 "\xD7\x9D\x20\x2D\x20\xD7\x99\xD7\x93\xD7\x99\ xD7\xA2" | |
| 294 "\xD7\x95\xD7\xAA\x20\xD7\x90\xD7\x97\xD7\xA8\ xD7\x95" | |
| 295 "\xD7\xA0\xD7\x95\xD7\xAA"); | |
| 296 std::string url(chrome::kChromeUISettingsURL); | |
| 297 url += std::string(chrome::kBrowserOptionsSubPage); | |
| 298 RunBidiCheckerOnPage(url.c_str()); | |
| 299 } | |
| 246 | 300 |
| 247 WebUIBidiCheckerBrowserTest::RunBidiCheckerOnPage(url.c_str(), true); | 301 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, |
| 302 TestSettingsBorwserOptionsPage) { | |
| 303 SetupTestSettingsBrowserOptions(browser()->profile(), | |
| 304 GURL("http://google.com"), | |
| 305 "Google"); | |
| 306 std::string url(chrome::kChromeUISettingsURL); | |
| 307 url += std::string(chrome::kBrowserOptionsSubPage); | |
| 308 RunBidiCheckerOnPage(url.c_str()); | |
| 248 } | 309 } |
| 310 | |
| 311 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 312 TestSettingsClearBrowserDataPage) { | |
| 313 std::string url(chrome::kChromeUISettingsURL); | |
| 314 url += std::string(chrome::kClearBrowserDataSubPage); | |
| 315 RunBidiCheckerOnPage(url.c_str()); | |
| 316 } | |
| 317 | |
| 318 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 319 TestSettingsClearBrowserDataPage) { | |
| 320 std::string url(chrome::kChromeUISettingsURL); | |
| 321 url += std::string(chrome::kClearBrowserDataSubPage); | |
| 322 RunBidiCheckerOnPage(url.c_str()); | |
| 323 } | |
| 324 | |
| 325 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 326 TestSettingsContentSettingsPage) { | |
| 327 std::string url(chrome::kChromeUISettingsURL); | |
| 328 url += std::string(chrome::kContentSettingsSubPage); | |
| 329 RunBidiCheckerOnPage(url.c_str()); | |
| 330 } | |
| 331 | |
| 332 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 333 TestSettingsContentSettingsPage) { | |
| 334 std::string url(chrome::kChromeUISettingsURL); | |
| 335 url += std::string(chrome::kContentSettingsSubPage); | |
| 336 RunBidiCheckerOnPage(url.c_str()); | |
| 337 } | |
| 338 | |
| 339 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 340 TestSettingsContentSettingsExceptionsPage) { | |
| 341 std::string url(chrome::kChromeUISettingsURL); | |
| 342 url += std::string(chrome::kContentSettingsExceptionsSubPage); | |
| 343 RunBidiCheckerOnPage(url.c_str()); | |
| 344 } | |
| 345 | |
| 346 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 347 TestSettingsContentSettingsExceptionsPage) { | |
| 348 std::string url(chrome::kChromeUISettingsURL); | |
| 349 url += std::string(chrome::kContentSettingsExceptionsSubPage); | |
| 350 RunBidiCheckerOnPage(url.c_str()); | |
| 351 } | |
| 352 | |
| 353 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 354 TestSettingsLanguageOptionsPage) { | |
| 355 std::string url(chrome::kChromeUISettingsURL); | |
| 356 url += std::string(chrome::kLanguageOptionsSubPage); | |
| 357 RunBidiCheckerOnPage(url.c_str()); | |
| 358 } | |
| 359 | |
| 360 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 361 TestSettingsLanguageOptionsPage) { | |
| 362 std::string url(chrome::kChromeUISettingsURL); | |
| 363 url += std::string(chrome::kLanguageOptionsSubPage); | |
| 364 RunBidiCheckerOnPage(url.c_str()); | |
| 365 } | |
| 366 | |
| 367 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestLTR, | |
| 368 TestSettingsSearchEnginesOptionsPage) { | |
| 369 std::string url(chrome::kChromeUISettingsURL); | |
| 370 url += std::string(chrome::kSearchEnginesSubPage); | |
| 371 RunBidiCheckerOnPage(url.c_str()); | |
| 372 } | |
| 373 | |
| 374 IN_PROC_BROWSER_TEST_F(WebUIBidiCheckerBrowserTestRTL, | |
| 375 TestSettingsSearchEnginesOptionsPage) { | |
| 376 std::string url(chrome::kChromeUISettingsURL); | |
| 377 url += std::string(chrome::kSearchEnginesSubPage); | |
| 378 RunBidiCheckerOnPage(url.c_str()); | |
| 379 } | |
| OLD | NEW |