OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" | 5 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
8 #include "chrome/browser/ui/passwords/manage_passwords_icon.h" | 8 #include "chrome/browser/ui/passwords/manage_passwords_icon.h" |
9 #include "chrome/browser/ui/passwords/manage_passwords_test.h" | 9 #include "chrome/browser/ui/passwords/manage_passwords_test.h" |
10 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" | 10 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller_mock.h" |
11 #include "chrome/browser/ui/views/frame/browser_view.h" | 11 #include "chrome/browser/ui/views/frame/browser_view.h" |
12 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" | 12 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" |
13 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" | 13 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" |
14 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
15 #include "components/password_manager/core/common/password_manager_ui.h" | 15 #include "components/password_manager/core/common/password_manager_ui.h" |
16 #include "content/public/test/test_utils.h" | 16 #include "content/public/test/test_utils.h" |
17 #include "grit/theme_resources.h" | 17 #include "grit/theme_resources.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 class ManagePasswordsIconViewTest : public ManagePasswordsTest { | 20 class ManagePasswordsIconViewTest : public ManagePasswordsTest { |
21 public: | 21 public: |
22 ManagePasswordsIconViewTest() {} | 22 ManagePasswordsIconViewTest() {} |
23 virtual ~ManagePasswordsIconViewTest() {} | 23 virtual ~ManagePasswordsIconViewTest() {} |
24 | 24 |
25 virtual ManagePasswordsIconView* view() OVERRIDE { | 25 virtual ManagePasswordsIconView* view() override { |
26 BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); | 26 BrowserView* browser_view = static_cast<BrowserView*>(browser()->window()); |
27 return static_cast<ManagePasswordsIconView*>( | 27 return static_cast<ManagePasswordsIconView*>( |
28 browser_view->GetToolbarView() | 28 browser_view->GetToolbarView() |
29 ->location_bar() | 29 ->location_bar() |
30 ->manage_passwords_icon_view()); | 30 ->manage_passwords_icon_view()); |
31 } | 31 } |
32 | 32 |
33 private: | 33 private: |
34 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsIconViewTest); | 34 DISALLOW_COPY_AND_ASSIGN(ManagePasswordsIconViewTest); |
35 }; | 35 }; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 EXPECT_TRUE(view()->visible()); | 85 EXPECT_TRUE(view()->visible()); |
86 EXPECT_TRUE(view()->active()); | 86 EXPECT_TRUE(view()->active()); |
87 ui::MouseEvent mouse_down(ui::ET_MOUSE_PRESSED, | 87 ui::MouseEvent mouse_down(ui::ET_MOUSE_PRESSED, |
88 gfx::Point(10, 10), gfx::Point(900, 60), | 88 gfx::Point(10, 10), gfx::Point(900, 60), |
89 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); | 89 ui::EF_LEFT_MOUSE_BUTTON, ui::EF_LEFT_MOUSE_BUTTON); |
90 view()->OnMousePressed(mouse_down); | 90 view()->OnMousePressed(mouse_down); |
91 // Wait for the command execution to close the bubble. | 91 // Wait for the command execution to close the bubble. |
92 content::RunAllPendingInMessageLoop(); | 92 content::RunAllPendingInMessageLoop(); |
93 EXPECT_FALSE(view()->active()); | 93 EXPECT_FALSE(view()->active()); |
94 } | 94 } |
OLD | NEW |