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

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

Issue 219743002: x11: Move X event handling out of the message-pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r261267 Created 6 years, 8 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/controls/menu/menu_message_pump_dispatcher_win.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/screen_position_client.h" 9 #include "ui/aura/client/screen_position_client.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 private: 459 private:
460 TestScreenPositionClient screen_position_client_; 460 TestScreenPositionClient screen_position_client_;
461 scoped_ptr<gfx::Screen> desktop_screen_; 461 scoped_ptr<gfx::Screen> desktop_screen_;
462 462
463 DISALLOW_COPY_AND_ASSIGN(TooltipControllerCaptureTest); 463 DISALLOW_COPY_AND_ASSIGN(TooltipControllerCaptureTest);
464 }; 464 };
465 465
466 // Verifies when capture is released the TooltipController resets state. 466 // Verifies when capture is released the TooltipController resets state.
467 TEST_F(TooltipControllerCaptureTest, CloseOnCaptureLost) { 467 TEST_F(TooltipControllerCaptureTest, CloseOnCaptureLost) {
468 view_->GetWidget()->SetCapture(view_); 468 view_->GetWidget()->SetCapture(view_);
469 RunAllPendingInMessageLoop();
469 view_->set_tooltip_text(ASCIIToUTF16("Tooltip Text")); 470 view_->set_tooltip_text(ASCIIToUTF16("Tooltip Text"));
470 generator_->MoveMouseToCenterOf(GetWindow()); 471 generator_->MoveMouseToCenterOf(GetWindow());
471 base::string16 expected_tooltip = ASCIIToUTF16("Tooltip Text"); 472 base::string16 expected_tooltip = ASCIIToUTF16("Tooltip Text");
472 EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(GetWindow())); 473 EXPECT_EQ(expected_tooltip, aura::client::GetTooltipText(GetWindow()));
473 EXPECT_EQ(base::string16(), helper_->GetTooltipText()); 474 EXPECT_EQ(base::string16(), helper_->GetTooltipText());
474 EXPECT_EQ(GetWindow(), helper_->GetTooltipWindow()); 475 EXPECT_EQ(GetWindow(), helper_->GetTooltipWindow());
475 476
476 // Fire tooltip timer so tooltip becomes visible. 477 // Fire tooltip timer so tooltip becomes visible.
477 helper_->FireTooltipTimer(); 478 helper_->FireTooltipTimer();
478 479
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 // the tooltip window is closed. 759 // the tooltip window is closed.
759 ui::CancelModeEvent event; 760 ui::CancelModeEvent event;
760 helper_->controller()->OnCancelMode(&event); 761 helper_->controller()->OnCancelMode(&event);
761 EXPECT_FALSE(helper_->IsTooltipVisible()); 762 EXPECT_FALSE(helper_->IsTooltipVisible());
762 EXPECT_TRUE(helper_->GetTooltipWindow() == NULL); 763 EXPECT_TRUE(helper_->GetTooltipWindow() == NULL);
763 } 764 }
764 765
765 } // namespace test 766 } // namespace test
766 } // namespace corewm 767 } // namespace corewm
767 } // namespace views 768 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_message_pump_dispatcher_win.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698