| 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/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
| 9 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 12 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 13 #include "chrome/app/chrome_dll_resource.h" | 14 #include "chrome/app/chrome_dll_resource.h" |
| 14 #include "chrome/browser/view_ids.h" | 15 #include "chrome/browser/view_ids.h" |
| 15 #include "chrome/common/chrome_constants.h" | 16 #include "chrome/common/chrome_constants.h" |
| 16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
| 17 #include "chrome/common/json_value_serializer.h" | 18 #include "chrome/common/json_value_serializer.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 gfx::Rect bounds; | 88 gfx::Rect bounds; |
| 88 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_0, &bounds, false)); | 89 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_0, &bounds, false)); |
| 89 EXPECT_GT(bounds.x(), 0); | 90 EXPECT_GT(bounds.x(), 0); |
| 90 EXPECT_GT(bounds.width(), 0); | 91 EXPECT_GT(bounds.width(), 0); |
| 91 EXPECT_GT(bounds.height(), 0); | 92 EXPECT_GT(bounds.height(), 0); |
| 92 | 93 |
| 93 gfx::Rect bounds2; | 94 gfx::Rect bounds2; |
| 94 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_LAST, &bounds2, false)); | 95 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_LAST, &bounds2, false)); |
| 95 EXPECT_GT(bounds2.width(), 0); | 96 EXPECT_GT(bounds2.width(), 0); |
| 96 EXPECT_GT(bounds2.height(), 0); | 97 EXPECT_GT(bounds2.height(), 0); |
| 97 EXPECT_GT(bounds2.x(), bounds.x()); | 98 |
| 99 // The tab logic is mirrored in RTL locales, so what is to the right in |
| 100 // LTR locales is now on the left with RTL ones. |
| 101 string16 browser_locale; |
| 102 |
| 103 EXPECT_TRUE(automation()->GetBrowserLocale(&browser_locale)); |
| 104 |
| 105 const std::string& locale_utf8 = UTF16ToUTF8(browser_locale); |
| 106 if (l10n_util::GetTextDirectionForLocale(locale_utf8.c_str()) == |
| 107 l10n_util::RIGHT_TO_LEFT) { |
| 108 EXPECT_LT(bounds2.x(), bounds.x()); |
| 109 } else { |
| 110 EXPECT_GT(bounds2.x(), bounds.x()); |
| 111 } |
| 112 |
| 98 EXPECT_EQ(bounds2.y(), bounds.y()); | 113 EXPECT_EQ(bounds2.y(), bounds.y()); |
| 99 | 114 |
| 100 gfx::Rect urlbar_bounds; | 115 gfx::Rect urlbar_bounds; |
| 101 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_LOCATION_BAR, &urlbar_bounds, | 116 ASSERT_TRUE(window->GetViewBounds(VIEW_ID_LOCATION_BAR, &urlbar_bounds, |
| 102 false)); | 117 false)); |
| 103 EXPECT_GT(urlbar_bounds.x(), 0); | 118 EXPECT_GT(urlbar_bounds.x(), 0); |
| 104 EXPECT_GT(urlbar_bounds.y(), 0); | 119 EXPECT_GT(urlbar_bounds.y(), 0); |
| 105 EXPECT_GT(urlbar_bounds.width(), 0); | 120 EXPECT_GT(urlbar_bounds.width(), 0); |
| 106 EXPECT_GT(urlbar_bounds.height(), 0); | 121 EXPECT_GT(urlbar_bounds.height(), 0); |
| 107 | 122 |
| (...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1007 | 1022 |
| 1008 // Allow some time for the popup to show up and close. | 1023 // Allow some time for the popup to show up and close. |
| 1009 PlatformThread::Sleep(2000); | 1024 PlatformThread::Sleep(2000); |
| 1010 | 1025 |
| 1011 std::wstring expected(L"string"); | 1026 std::wstring expected(L"string"); |
| 1012 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); | 1027 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); |
| 1013 std::wstring actual; | 1028 std::wstring actual; |
| 1014 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); | 1029 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); |
| 1015 ASSERT_EQ(expected, actual); | 1030 ASSERT_EQ(expected, actual); |
| 1016 } | 1031 } |
| OLD | NEW |