OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync/one_click_signin_bubble_view.h" | 5 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_window.h" | 9 #include "chrome/browser/ui/browser_window.h" |
10 #include "chrome/test/base/in_process_browser_test.h" | 10 #include "chrome/test/base/in_process_browser_test.h" |
11 #include "chrome/test/base/ui_test_utils.h" | 11 #include "chrome/test/base/ui_test_utils.h" |
12 #include "content/public/common/page_transition_types.h" | 12 #include "content/public/common/page_transition_types.h" |
13 #include "ui/views/controls/button/text_button.h" | 13 #include "ui/views/controls/button/text_button.h" |
14 #include "ui/views/events/event.h" | |
15 | 14 |
16 class OneClickSigninBubbleViewBrowserTest : public InProcessBrowserTest { | 15 class OneClickSigninBubbleViewBrowserTest : public InProcessBrowserTest { |
17 public: | 16 public: |
18 OneClickSigninBubbleViewBrowserTest() | 17 OneClickSigninBubbleViewBrowserTest() |
19 : on_start_sync_called_(false), | 18 : on_start_sync_called_(false), |
20 mode_(OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST) { | 19 mode_(OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST) { |
21 } | 20 } |
22 | 21 |
23 OneClickSigninBubbleView* ShowOneClickSigninBubble() { | 22 OneClickSigninBubbleView* ShowOneClickSigninBubble() { |
24 browser()->window()->ShowOneClickSigninBubble( | 23 browser()->window()->ShowOneClickSigninBubble( |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 views::View* view = one_click_view; | 144 views::View* view = one_click_view; |
146 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0); | 145 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0); |
147 view->AcceleratorPressed(accelerator); | 146 view->AcceleratorPressed(accelerator); |
148 | 147 |
149 // View should no longer be showing. The message loop will exit once the | 148 // View should no longer be showing. The message loop will exit once the |
150 // fade animation of the bubble is done. | 149 // fade animation of the bubble is done. |
151 content::RunMessageLoop(); | 150 content::RunMessageLoop(); |
152 EXPECT_FALSE(on_start_sync_called_); | 151 EXPECT_FALSE(on_start_sync_called_); |
153 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing()); | 152 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing()); |
154 } | 153 } |
OLD | NEW |