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

Side by Side Diff: ui/views/corewm/tooltip_controller_unittest.cc

Issue 23477022: Two changes to desktop aura for tooltips: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 2013 Created 7 years, 3 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 | « ui/views/corewm/tooltip_controller.cc ('k') | ui/views/views.gyp » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/views/corewm/tooltip_controller.h" 5 #include "ui/views/corewm/tooltip_controller.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/aura/client/cursor_client.h" 8 #include "ui/aura/client/cursor_client.h"
9 #include "ui/aura/client/tooltip_client.h" 9 #include "ui/aura/client/tooltip_client.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 EXPECT_TRUE(helper_->IsTooltipTimerRunning()); 402 EXPECT_TRUE(helper_->IsTooltipTimerRunning());
403 helper_->FireTooltipTimer(); 403 helper_->FireTooltipTimer();
404 EXPECT_TRUE(helper_->IsTooltipVisible()); 404 EXPECT_TRUE(helper_->IsTooltipVisible());
405 EXPECT_TRUE(helper_->IsTooltipShownTimerRunning()); 405 EXPECT_TRUE(helper_->IsTooltipShownTimerRunning());
406 string16 expected_tooltip = ASCIIToUTF16("Tooltip Text for view 2"); 406 string16 expected_tooltip = ASCIIToUTF16("Tooltip Text for view 2");
407 EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(window)); 407 EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(window));
408 EXPECT_EQ(expected_tooltip, helper_->GetTooltipText()); 408 EXPECT_EQ(expected_tooltip, helper_->GetTooltipText());
409 EXPECT_EQ(window, helper_->GetTooltipWindow()); 409 EXPECT_EQ(window, helper_->GetTooltipWindow());
410 } 410 }
411 411
412 // Verifies a mouse exit event hides the tooltips.
413 TEST_F(TooltipControllerTest, HideOnExit) {
414 view_->set_tooltip_text(ASCIIToUTF16("Tooltip Text"));
415 generator_->MoveMouseToCenterOf(GetWindow());
416 string16 expected_tooltip = ASCIIToUTF16("Tooltip Text");
417 EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(GetWindow()));
418 EXPECT_EQ(string16(), helper_->GetTooltipText());
419 EXPECT_EQ(GetWindow(), helper_->GetTooltipWindow());
420
421 // Fire tooltip timer so tooltip becomes visible.
422 helper_->FireTooltipTimer();
423
424 EXPECT_TRUE(helper_->IsTooltipVisible());
425 generator_->SendMouseExit();
426 EXPECT_FALSE(helper_->IsTooltipVisible());
427 }
428
412 } // namespace test 429 } // namespace test
413 } // namespace corewm 430 } // namespace corewm
414 } // namespace views 431 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/corewm/tooltip_controller.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698