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

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

Issue 99343006: Merge 237115 "Security fix for untrusted signin confirm dialog" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1700/src/
Patch Set: Created 7 years 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
« no previous file with comments | « chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 TEST_F(OneClickSigninBubbleViewTest, HideDialog) { 134 TEST_F(OneClickSigninBubbleViewTest, HideDialog) {
135 ShowOneClickSigninBubble( 135 ShowOneClickSigninBubble(
136 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_MODAL_DIALOG); 136 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_MODAL_DIALOG);
137 137
138 OneClickSigninBubbleView::Hide(); 138 OneClickSigninBubbleView::Hide();
139 content::RunAllPendingInMessageLoop(); 139 content::RunAllPendingInMessageLoop();
140 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing()); 140 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing());
141 EXPECT_TRUE(on_start_sync_called_); 141 EXPECT_TRUE(on_start_sync_called_);
142 EXPECT_EQ(OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS, mode_); 142 EXPECT_EQ(OneClickSigninSyncStarter::UNDO_SYNC, mode_);
143 } 143 }
144 144
145 TEST_F(OneClickSigninBubbleViewTest, BubbleOkButton) { 145 TEST_F(OneClickSigninBubbleViewTest, BubbleOkButton) {
146 OneClickSigninBubbleView* view = 146 OneClickSigninBubbleView* view =
147 ShowOneClickSigninBubble( 147 ShowOneClickSigninBubble(
148 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE); 148 BrowserWindow::ONE_CLICK_SIGNIN_BUBBLE_TYPE_BUBBLE);
149 149
150 // Simulate pressing the OK button. Set the message loop in the bubble 150 // Simulate pressing the OK button. Set the message loop in the bubble
151 // view so that it can be quit once the bubble is hidden. 151 // view so that it can be quit once the bubble is hidden.
152 views::ButtonListener* listener = view; 152 views::ButtonListener* listener = view;
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
319 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0); 319 const ui::Accelerator accelerator(ui::VKEY_ESCAPE, 0);
320 view->AcceleratorPressed(accelerator); 320 view->AcceleratorPressed(accelerator);
321 321
322 // View should no longer be showing. The message loop will exit once the 322 // View should no longer be showing. The message loop will exit once the
323 // fade animation of the bubble is done. 323 // fade animation of the bubble is done.
324 content::RunAllPendingInMessageLoop(); 324 content::RunAllPendingInMessageLoop();
325 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing()); 325 EXPECT_FALSE(OneClickSigninBubbleView::IsShowing());
326 EXPECT_TRUE(on_start_sync_called_); 326 EXPECT_TRUE(on_start_sync_called_);
327 EXPECT_EQ(OneClickSigninSyncStarter::UNDO_SYNC, mode_); 327 EXPECT_EQ(OneClickSigninSyncStarter::UNDO_SYNC, mode_);
328 } 328 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698