OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "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 "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/sync/one_click_signin_bubble_delegate.h" | 10 #include "chrome/browser/ui/sync/one_click_signin_bubble_delegate.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" | |
13 #include "ui/views/controls/button/label_button.h" | 12 #include "ui/views/controls/button/label_button.h" |
14 #include "ui/views/test/views_test_base.h" | 13 #include "ui/views/test/views_test_base.h" |
15 #include "ui/views/widget/widget.h" | 14 #include "ui/views/widget/widget.h" |
16 | 15 |
17 class OneClickSigninBubbleViewTest : public views::ViewsTestBase { | 16 class OneClickSigninBubbleViewTest : public views::ViewsTestBase { |
18 public: | 17 public: |
19 OneClickSigninBubbleViewTest() | 18 OneClickSigninBubbleViewTest() |
20 : on_start_sync_called_(false), | 19 : on_start_sync_called_(false), |
21 mode_(OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST), | 20 mode_(OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST), |
22 bubble_learn_more_click_count_(0), | 21 bubble_learn_more_click_count_(0), |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0); | 317 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0); |
319 view->AcceleratorPressed(accelerator); | 318 view->AcceleratorPressed(accelerator); |
320 | 319 |
321 // View should no longer be showing. The message loop will exit once the | 320 // View should no longer be showing. The message loop will exit once the |
322 // fade animation of the bubble is done. | 321 // fade animation of the bubble is done. |
323 content::RunAllPendingInMessageLoop(); | 322 content::RunAllPendingInMessageLoop(); |
324 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing()); | 323 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing()); |
325 EXPECT_TRUE(on_start_sync_called_); | 324 EXPECT_TRUE(on_start_sync_called_); |
326 EXPECT_EQ(OneClickSigninSyncStarter::UNDO_SYNC, mode_); | 325 EXPECT_EQ(OneClickSigninSyncStarter::UNDO_SYNC, mode_); |
327 } | 326 } |
OLD | NEW |