| Index: ash/launcher/launcher_view_unittest.cc
|
| diff --git a/ash/launcher/launcher_view_unittest.cc b/ash/launcher/launcher_view_unittest.cc
|
| index d1e2e768c164c6a6df29944b88f0eab248ffcca4..7637ef5887366a74cdf434b2ca4c2b41902643df 100644
|
| --- a/ash/launcher/launcher_view_unittest.cc
|
| +++ b/ash/launcher/launcher_view_unittest.cc
|
| @@ -31,6 +31,7 @@
|
| #include "ui/base/events/event.h"
|
| #include "ui/base/events/event_constants.h"
|
| #include "ui/compositor/layer.h"
|
| +#include "ui/views/view_model.h"
|
| #include "ui/views/widget/widget.h"
|
| #include "ui/views/widget/widget_delegate.h"
|
|
|
| @@ -377,6 +378,47 @@ class LauncherViewTest : public AshTestBase {
|
| DISALLOW_COPY_AND_ASSIGN(LauncherViewTest);
|
| };
|
|
|
| +class LauncherViewRTLTest : public LauncherViewTest {
|
| + public:
|
| + LauncherViewRTLTest() {}
|
| + virtual ~LauncherViewRTLTest() {}
|
| +
|
| + virtual void SetUp() OVERRIDE {
|
| + base::i18n::SetICUDefaultLocale("ar");
|
| + LauncherViewTest::SetUp();
|
| + ASSERT_TRUE(base::i18n::IsRTL());
|
| + }
|
| +
|
| + private:
|
| + DISALLOW_COPY_AND_ASSIGN(LauncherViewRTLTest);
|
| +};
|
| +
|
| +// Checks that the ideal item icon bounds match the view's bounds in the screen.
|
| +TEST_F(LauncherViewTest, IdealBoundsOfItemIcon) {
|
| + LauncherID id = AddTabbedBrowser();
|
| + internal::LauncherButton* button = GetButtonByID(id);
|
| + gfx::Rect item_bounds = button->GetBoundsInScreen();
|
| + gfx::Rect ideal_bounds = launcher_view_->GetIdealBoundsOfItemIcon(id);
|
| + gfx::Point screen_origin;
|
| + views::View::ConvertPointToScreen(launcher_view_, &screen_origin);
|
| + ideal_bounds.Offset(screen_origin.x(), screen_origin.y());
|
| + EXPECT_EQ(item_bounds.x(), ideal_bounds.x());
|
| + EXPECT_EQ(item_bounds.y(), ideal_bounds.y());
|
| +}
|
| +
|
| +// Checks that the ideal item icon bounds are correct in RTL.
|
| +TEST_F(LauncherViewRTLTest, IdealBoundsOfItemIcon) {
|
| + LauncherID id = AddTabbedBrowser();
|
| + internal::LauncherButton* button = GetButtonByID(id);
|
| + gfx::Rect item_bounds = button->GetBoundsInScreen();
|
| + gfx::Rect ideal_bounds = launcher_view_->GetIdealBoundsOfItemIcon(id);
|
| + gfx::Point screen_origin;
|
| + views::View::ConvertPointToScreen(launcher_view_, &screen_origin);
|
| + ideal_bounds.Offset(screen_origin.x(), screen_origin.y());
|
| + EXPECT_EQ(item_bounds.x(), ideal_bounds.x());
|
| + EXPECT_EQ(item_bounds.y(), ideal_bounds.y());
|
| +}
|
| +
|
| // Checks that the icon positions do not shift with a state change.
|
| TEST_F(LauncherViewTest, NoStateChangeIconMovement) {
|
| LauncherID last_added = AddAppShortcut();
|
|
|