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

Unified Diff: chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc

Issue 1814513002: Fix sizing issues in the tab modal signin flow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests Created 4 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
« no previous file with comments | « chrome/browser/ui/webui/signin/sync_confirmation_handler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc
diff --git a/chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc b/chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc
index 72cf264c801ffef36e1c464f3fead2c0bf289450..64ffa58a6b32ef8504c45773995faa98f7f04952 100644
--- a/chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc
+++ b/chrome/browser/ui/webui/signin/sync_confirmation_handler_unittest.cc
@@ -27,6 +27,10 @@
const int kExpectedProfileImageSize = 128;
+// The dialog needs to be initialized with a height but the actual value doesn't
+// really matter in unit tests.
+const double kDefaultDialogHeight = 350.0;
+
class TestingSyncConfirmationHandler : public SyncConfirmationHandler {
public:
explicit TestingSyncConfirmationHandler(content::WebUI* web_ui) {
@@ -35,7 +39,7 @@ class TestingSyncConfirmationHandler : public SyncConfirmationHandler {
using SyncConfirmationHandler::HandleConfirm;
using SyncConfirmationHandler::HandleUndo;
- using SyncConfirmationHandler::HandleInitialized;
+ using SyncConfirmationHandler::HandleInitializedWithSize;
using SyncConfirmationHandler::HandleGoToSettings;
using SyncConfirmationHandler::SetUserImageURL;
};
@@ -125,6 +129,7 @@ private:
};
TEST_F(SyncConfirmationHandlerTest, TestSetImageIfPrimaryAccountReady) {
+ browser()->ShowModalSyncConfirmationWindow();
account_fetcher_service()->FakeUserInfoFetchSuccess(
"gaia",
"foo@example.com",
@@ -135,7 +140,9 @@ TEST_F(SyncConfirmationHandlerTest, TestSetImageIfPrimaryAccountReady) {
"locale",
"http://picture.example.com/picture.jpg");
- handler()->HandleInitialized(nullptr);
+ base::ListValue args;
+ args.Set(0, new base::FundamentalValue(kDefaultDialogHeight));
+ handler()->HandleInitializedWithSize(&args);
EXPECT_EQ(1U, web_ui()->call_data().size());
EXPECT_EQ("sync.confirmation.setUserImageURL",
web_ui()->call_data()[0]->function_name());
@@ -157,7 +164,11 @@ TEST_F(SyncConfirmationHandlerTest, TestSetImageIfPrimaryAccountReady) {
}
TEST_F(SyncConfirmationHandlerTest, TestSetImageIfPrimaryAccountReadyLater) {
- handler()->HandleInitialized(nullptr);
+ browser()->ShowModalSyncConfirmationWindow();
+
+ base::ListValue args;
+ args.Set(0, new base::FundamentalValue(kDefaultDialogHeight));
+ handler()->HandleInitializedWithSize(&args);
EXPECT_EQ(0U, web_ui()->call_data().size());
account_fetcher_service()->FakeUserInfoFetchSuccess(
« no previous file with comments | « chrome/browser/ui/webui/signin/sync_confirmation_handler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698