Chromium Code Reviews| Index: chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc |
| diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc |
| index 4338aaaef30f4e2c7fdde9976669827ab19c82ce..bcaa0180eb78b2459286f0fd1ac40a03cc4e732e 100644 |
| --- a/chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc |
| +++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc |
| @@ -8,6 +8,7 @@ |
| #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" |
| #include "chrome/browser/ui/views/passwords/manage_passwords_view_test.h" |
| #include "components/password_manager/core/common/password_manager_ui.h" |
| +#include "content/public/test/test_utils.h" |
| #include "grit/generated_resources.h" |
| #include "grit/theme_resources.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| @@ -59,3 +60,16 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsIconViewTest, BlacklistedState) { |
| view()->SetActive(false); |
| EXPECT_EQ(IDR_SAVE_PASSWORD_DISABLED_INACTIVE, view()->icon_id()); |
| } |
| + |
| +IN_PROC_BROWSER_TEST_F(ManagePasswordsIconViewTest, CloseOnClick) { |
| + SetupPendingPassword(); |
| + EXPECT_TRUE(view()->visible()); |
| + EXPECT_TRUE(view()->active()); |
| + ui::MouseEvent mouse_down(ui::ET_MOUSE_PRESSED, |
| + gfx::Point(10, 10), gfx::Point(900, 60), |
| + ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); |
| + static_cast<views::View*>(view())->OnMousePressed(mouse_down); |
|
Peter Kasting
2014/07/24 18:18:08
This cast surprises me; what's the type of view()
vasilii
2014/07/25 08:24:34
The type is ManagePasswordsIconView*. BubbleIconVi
Peter Kasting
2014/07/25 20:34:28
Make OnMousePressed() public and remove this cast,
vasilii
2014/07/28 15:58:59
Done.
|
| + // Wait for the command execution to close the bubble. |
| + content::RunAllPendingInMessageLoop(); |
| + EXPECT_FALSE(view()->active()); |
| +} |