| Index: ui/views/corewm/tooltip_controller_unittest.cc
|
| diff --git a/ui/views/corewm/tooltip_controller_unittest.cc b/ui/views/corewm/tooltip_controller_unittest.cc
|
| index 54aa14f8ad6c3e970472504d156c2a5c7519ea5f..d8f14803cf510ca7689073604bdd33c41bf2aab9 100644
|
| --- a/ui/views/corewm/tooltip_controller_unittest.cc
|
| +++ b/ui/views/corewm/tooltip_controller_unittest.cc
|
| @@ -93,9 +93,9 @@ class TooltipControllerTest : public ViewsTestBase {
|
|
|
| new wm::DefaultActivationClient(root_window);
|
| #if defined(OS_CHROMEOS)
|
| - controller_.reset(
|
| - new TooltipController(std::unique_ptr<views::corewm::Tooltip>(
|
| - new views::corewm::TooltipAura)));
|
| + tooltip_aura_ = new views::corewm::TooltipAura();
|
| + controller_.reset(new TooltipController(
|
| + std::unique_ptr<views::corewm::Tooltip>(tooltip_aura_)));
|
| root_window->AddPreTargetHandler(controller_.get());
|
| SetTooltipClient(root_window, controller_.get());
|
| #endif
|
| @@ -161,6 +161,11 @@ class TooltipControllerTest : public ViewsTestBase {
|
| std::unique_ptr<TooltipControllerTestHelper> helper_;
|
| std::unique_ptr<ui::test::EventGenerator> generator_;
|
|
|
| + protected:
|
| +#if defined(OS_CHROMEOS)
|
| + TooltipAura* tooltip_aura_; // not owned.
|
| +#endif
|
| +
|
| private:
|
| std::unique_ptr<TooltipController> controller_;
|
|
|
| @@ -199,7 +204,31 @@ TEST_F(TooltipControllerTest, ViewTooltip) {
|
| EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(GetWindow()));
|
| EXPECT_EQ(expected_tooltip, helper_->GetTooltipText());
|
| EXPECT_EQ(GetWindow(), helper_->GetTooltipWindow());
|
| + EXPECT_EQ(1u, tooltip_aura_->GetLineSizeForTest());
|
| +}
|
| +
|
| +#if defined(OS_CHROMEOS)
|
| +// crbug.com/664370.
|
| +TEST_F(TooltipControllerTest, MaxWidth) {
|
| + base::string16 text = base::ASCIIToUTF16(
|
| + "List of law clerks of the Supreme Court of the United States - "
|
| + "Wikipedia\n");
|
| + text += gfx::kEllipsisUTF16 + base::ASCIIToUTF16("wikipedia.org/") +
|
| + gfx::kEllipsisUTF16 +
|
| + base::ASCIIToUTF16(
|
| + "/List_of_law_clerks_of_the_Supreme_Court_of_the_Unite") +
|
| + +gfx::kEllipsisUTF16;
|
| +
|
| + view_->set_tooltip_text(text);
|
| + generator_->MoveMouseToCenterOf(GetWindow());
|
| +
|
| + // Fire tooltip timer so tooltip becomes visible.
|
| + helper_->FireTooltipTimer();
|
| +
|
| + EXPECT_TRUE(helper_->IsTooltipVisible());
|
| + EXPECT_EQ(2u, tooltip_aura_->GetLineSizeForTest());
|
| }
|
| +#endif
|
|
|
| TEST_F(TooltipControllerTest, TooltipsInMultipleViews) {
|
| // TODO: these tests use GetContext(). That should go away for aura-mus
|
|
|