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

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

Issue 14307023: chrome: Use base::MessageLoop. (Part 2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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/browser/ui/tabs/tab_strip_model.h" 10 #include "chrome/browser/ui/tabs/tab_strip_model.h"
(...skipping 13 matching lines...) Expand all
24 BrowserWindow::OneClickSigninBubbleType bubble_type) { 24 BrowserWindow::OneClickSigninBubbleType bubble_type) {
25 browser()->window()->ShowOneClickSigninBubble( 25 browser()->window()->ShowOneClickSigninBubble(
26 bubble_type, 26 bubble_type,
27 string16(), 27 string16(),
28 string16(), 28 string16(),
29 base::Bind(&OneClickSigninBubbleViewBrowserTest::OnStartSync, this)); 29 base::Bind(&OneClickSigninBubbleViewBrowserTest::OnStartSync, this));
30 30
31 OneClickSigninBubbleView* view = 31 OneClickSigninBubbleView* view =
32 OneClickSigninBubbleView::view_for_testing(); 32 OneClickSigninBubbleView::view_for_testing();
33 EXPECT_TRUE(view != NULL); 33 EXPECT_TRUE(view != NULL);
34 view->message_loop_for_testing_ = MessageLoop::current(); 34 view->message_loop_for_testing_ = base::MessageLoop::current();
35 return view; 35 return view;
36 } 36 }
37 37
38 void OnStartSync(OneClickSigninSyncStarter::StartSyncMode mode) { 38 void OnStartSync(OneClickSigninSyncStarter::StartSyncMode mode) {
39 on_start_sync_called_ = true; 39 on_start_sync_called_ = true;
40 mode_ = mode; 40 mode_ = mode;
41 } 41 }
42 42
43 protected: 43 protected:
44 bool on_start_sync_called_; 44 bool on_start_sync_called_;
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 views::View* view = one_click_view; 254 views::View* view = one_click_view;
255 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0); 255 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0);
256 view->AcceleratorPressed(accelerator); 256 view->AcceleratorPressed(accelerator);
257 257
258 // View should no longer be showing. The message loop will exit once the 258 // View should no longer be showing. The message loop will exit once the
259 // fade animation of the bubble is done. 259 // fade animation of the bubble is done.
260 content::RunAllPendingInMessageLoop(); 260 content::RunAllPendingInMessageLoop();
261 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing()); 261 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing());
262 EXPECT_FALSE(on_start_sync_called_); 262 EXPECT_FALSE(on_start_sync_called_);
263 } 263 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698