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

Side by Side Diff: chrome/test/automation/automation_proxy_uitest.cc

Issue 1073005: Move RTL related functions from app/l10n_util to base/i18n/rtl... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months 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
« no previous file with comments | « chrome/renderer/localized_error.cc ('k') | views/accelerator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <string> 5 #include <string>
6 6
7 #include "app/app_switches.h" 7 #include "app/app_switches.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/message_box_flags.h" 9 #include "app/message_box_flags.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/file_path.h" 12 #include "base/file_path.h"
13 #include "base/i18n/rtl.h"
13 #include "base/keyboard_codes.h" 14 #include "base/keyboard_codes.h"
14 #include "base/string_util.h" 15 #include "base/string_util.h"
15 #include "base/sys_info.h" 16 #include "base/sys_info.h"
16 #include "build/build_config.h" 17 #include "build/build_config.h"
17 #include "chrome/app/chrome_dll_resource.h" 18 #include "chrome/app/chrome_dll_resource.h"
18 #include "chrome/browser/net/url_request_slow_http_job.h" 19 #include "chrome/browser/net/url_request_slow_http_job.h"
19 #include "chrome/browser/view_ids.h" 20 #include "chrome/browser/view_ids.h"
20 #include "chrome/common/chrome_constants.h" 21 #include "chrome/common/chrome_constants.h"
21 #include "chrome/common/chrome_switches.h" 22 #include "chrome/common/chrome_switches.h"
22 #include "chrome/common/json_value_serializer.h" 23 #include "chrome/common/json_value_serializer.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 EXPECT_GT(bounds2.width(), 0); 116 EXPECT_GT(bounds2.width(), 0);
116 EXPECT_GT(bounds2.height(), 0); 117 EXPECT_GT(bounds2.height(), 0);
117 118
118 // The tab logic is mirrored in RTL locales, so what is to the right in 119 // The tab logic is mirrored in RTL locales, so what is to the right in
119 // LTR locales is now on the left with RTL ones. 120 // LTR locales is now on the left with RTL ones.
120 string16 browser_locale; 121 string16 browser_locale;
121 122
122 EXPECT_TRUE(automation()->GetBrowserLocale(&browser_locale)); 123 EXPECT_TRUE(automation()->GetBrowserLocale(&browser_locale));
123 124
124 const std::string& locale_utf8 = UTF16ToUTF8(browser_locale); 125 const std::string& locale_utf8 = UTF16ToUTF8(browser_locale);
125 if (l10n_util::GetTextDirectionForLocale(locale_utf8.c_str()) == 126 if (base::i18n::GetTextDirectionForLocale(locale_utf8.c_str()) ==
126 l10n_util::RIGHT_TO_LEFT) { 127 base::i18n::RIGHT_TO_LEFT) {
127 EXPECT_LT(bounds2.x(), bounds.x()); 128 EXPECT_LT(bounds2.x(), bounds.x());
128 } else { 129 } else {
129 EXPECT_GT(bounds2.x(), bounds.x()); 130 EXPECT_GT(bounds2.x(), bounds.x());
130 } 131 }
131 EXPECT_EQ(bounds2.y(), bounds.y()); 132 EXPECT_EQ(bounds2.y(), bounds.y());
132 133
133 gfx::Rect urlbar_bounds; 134 gfx::Rect urlbar_bounds;
134 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_LOCATION_BAR, &urlbar_bounds, 135 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_LOCATION_BAR, &urlbar_bounds,
135 false)); 136 false));
136 EXPECT_GT(urlbar_bounds.x(), 0); 137 EXPECT_GT(urlbar_bounds.x(), 0);
(...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 1532
1532 // Allow some time for the popup to show up and close. 1533 // Allow some time for the popup to show up and close.
1533 PlatformThread::Sleep(2000); 1534 PlatformThread::Sleep(2000);
1534 1535
1535 std::wstring expected(L"string"); 1536 std::wstring expected(L"string");
1536 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); 1537 std::wstring jscript = CreateJSString(L"\"" + expected + L"\"");
1537 std::wstring actual; 1538 std::wstring actual;
1538 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); 1539 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual));
1539 ASSERT_EQ(expected, actual); 1540 ASSERT_EQ(expected, actual);
1540 } 1541 }
OLDNEW
« no previous file with comments | « chrome/renderer/localized_error.cc ('k') | views/accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698