OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |