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

Unified Diff: chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm

Issue 13845022: Mac: Display a native bubble (instead of the JS one) after the web signin flow. (branched from http… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ntpBubble
Patch Set: Ditto Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm
diff --git a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm
index 0cb313b204e086cf30f073b3969839b5546ed533..86ac82668d38fb222d421d9f848ce55c48d2d57c 100644
--- a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_unittest.mm
@@ -36,6 +36,8 @@ class OneClickSigninBubbleControllerTest : public CocoaProfileTest {
static_cast<BrowserWindowCocoa*>(browser()->window());
controller_.reset([[OneClickSigninBubbleController alloc]
initWithBrowserWindowController:browser_window->cocoa_controller()
+ webContents:nil
+ errorMessage:nil
callback:start_sync_callback_]);
[controller_ showWindow:nil];
EXPECT_NSEQ(@"OneClickSigninBubble",
@@ -58,35 +60,25 @@ class OneClickSigninBubbleControllerTest : public CocoaProfileTest {
DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleControllerTest);
};
-// Test that the bubble calls the callback if the OK button is clicked.
-// Callback should be called to setup sync with default settings.
+// Test that the bubble does not sync if the OK button is clicked.
TEST_F(OneClickSigninBubbleControllerTest, OK) {
EXPECT_CALL(*this, OnStartSync(
- OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS));
+ OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS)).Times(0);
[[controller_ viewController] ok:nil];
}
-// Test that the dialog calls the callback if the Undo button
+// Test that the bubble does not sync if the Undo button
// is clicked. Callback should be called to abort the sync.
TEST_F(OneClickSigninBubbleControllerTest, Undo) {
EXPECT_CALL(*this, OnStartSync(
- OneClickSigninSyncStarter::UNDO_SYNC)).Times(1);
+ OneClickSigninSyncStarter::UNDO_SYNC)).Times(0);
[[controller_ viewController] onClickUndo:nil];
}
-// Test that the advanced callback is run if its corresponding button
-// is clicked.
-TEST_F(OneClickSigninBubbleControllerTest, Advanced) {
- EXPECT_CALL(*this, OnStartSync(
- OneClickSigninSyncStarter::CONFIGURE_SYNC_FIRST));
- [[controller_ viewController] onClickAdvancedLink:nil];
-}
-
-// Test that the bubble calls the callback if the bubble is closed.
-// Callback should be called to setup sync with default settings.
+// Test that the bubble does not sync if the bubble is closed.
TEST_F(OneClickSigninBubbleControllerTest, Close) {
EXPECT_CALL(*this, OnStartSync(
- OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS));
+ OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS)).Times(0);
[controller_ close];
}

Powered by Google App Engine
This is Rietveld 408576698