Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(219)

Side by Side Diff: chrome/browser/ui/views/sync/one_click_signin_bubble_view_unittest.cc

Issue 22743002: Convert OneClickSigninBubbleViewTest to browser_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 10 matching lines...) Expand all
21 mode_(OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST), 21 mode_(OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST),
22 bubble_learn_more_click_count_(0), 22 bubble_learn_more_click_count_(0),
23 dialog_learn_more_click_count_(0), 23 dialog_learn_more_click_count_(0),
24 advanced_click_count_(0), 24 advanced_click_count_(0),
25 anchor_widget_(NULL) { 25 anchor_widget_(NULL) {
26 } 26 }
27 27
28 virtual void SetUp() OVERRIDE { 28 virtual void SetUp() OVERRIDE {
29 views::ViewsTestBase::SetUp(); 29 views::ViewsTestBase::SetUp();
30 30
31 OneClickSigninBubbleView::set_close_on_deactivate_for_testing(false);
32
31 // Create a widget to host the anchor view. 33 // Create a widget to host the anchor view.
32 anchor_widget_ = new views::Widget; 34 anchor_widget_ = new views::Widget;
33 views::Widget::InitParams widget_params = CreateParams( 35 views::Widget::InitParams widget_params = CreateParams(
34 views::Widget::InitParams::TYPE_WINDOW); 36 views::Widget::InitParams::TYPE_WINDOW);
35 anchor_widget_->Init(widget_params); 37 anchor_widget_->Init(widget_params);
36 anchor_widget_->Show(); 38 anchor_widget_->Show();
37 } 39 }
38 40
39 virtual void TearDown() OVERRIDE { 41 virtual void TearDown() OVERRIDE {
40 OneClickSigninBubbleView::Hide(); 42 OneClickSigninBubbleView::Hide();
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 views::View* view = one_click_view; 320 views::View* view = one_click_view;
319 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0); 321 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0);
320 view->AcceleratorPressed(accelerator); 322 view->AcceleratorPressed(accelerator);
321 323
322 // View should no longer be showing. The message loop will exit once the 324 // View should no longer be showing. The message loop will exit once the
323 // fade animation of the bubble is done. 325 // fade animation of the bubble is done.
324 content::RunAllPendingInMessageLoop(); 326 content::RunAllPendingInMessageLoop();
325 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing()); 327 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing());
326 EXPECT_FALSE(on_start_sync_called_); 328 EXPECT_FALSE(on_start_sync_called_);
327 } 329 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698