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
3 // found in the LICENSE file.
5 #ifndef UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_TEST_HELPER_H_
6 #define UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_TEST_HELPER_H_
8 #include "base/logging.h"
9 #include "base/strings/string16.h"
10 #include "ui/views/view.h"
11 #include "ui/views/views_export.h"
20 class TooltipController
;
24 // TooltipControllerTestHelper provides access to TooltipControllers private
26 class TooltipControllerTestHelper
{
28 explicit TooltipControllerTestHelper(TooltipController
* controller
);
29 ~TooltipControllerTestHelper();
31 TooltipController
* controller() { return controller_
; }
33 // These are mostly cover methods for TooltipController private methods.
34 base::string16
GetTooltipText();
35 aura::Window
* GetTooltipWindow();
36 void FireTooltipTimer();
37 bool IsTooltipTimerRunning();
38 void FireTooltipShownTimer();
39 bool IsTooltipShownTimerRunning();
40 bool IsTooltipVisible();
43 TooltipController
* controller_
;
45 DISALLOW_COPY_AND_ASSIGN(TooltipControllerTestHelper
);
48 // Trivial View subclass that lets you set the tooltip text.
49 class TooltipTestView
: public views::View
{
52 ~TooltipTestView() override
;
54 void set_tooltip_text(base::string16 tooltip_text
) {
55 tooltip_text_
= tooltip_text
;
58 // Overridden from views::View
59 bool GetTooltipText(const gfx::Point
& p
,
60 base::string16
* tooltip
) const override
;
63 base::string16 tooltip_text_
;
65 DISALLOW_COPY_AND_ASSIGN(TooltipTestView
);
73 #endif // UI_VIEWS_COREWM_TOOLTIP_CONTROLLER_TEST_HELPER_H_