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

Unified Diff: chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc

Issue 2540683002: Don't defer quitting in ExecuteScript and other helpers that use DOMMessageQueue. (Closed)
Patch Set: Change FIXME to TODO. Created 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc b/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
index d0b0e410e99776f683003aaf202fcfb8ea9f9e71..a2b54739b2e45da07c928126cb27f0068eea4cab 100644
--- a/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
+++ b/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
@@ -164,12 +164,20 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserTransactionCleanupTest,
StartFlowLoginAsManager();
FillNewUserData(kTestSupervisedUserDisplayName);
+ base::RunLoop mount_wait_loop;
+ base::RunLoop add_key_wait_loop;
achuithb 2016/11/30 22:39:52 Any reason to not put both on the same line?
Alexander Semashko 2016/12/01 12:24:59 Done. I thought it was discouraged by the style gu
+ mock_homedir_methods_->set_mount_callback(mount_wait_loop.QuitClosure());
+ mock_homedir_methods_->set_add_key_callback(add_key_wait_loop.QuitClosure());
EXPECT_CALL(*mock_homedir_methods_, MountEx(_, _, _, _)).Times(1);
EXPECT_CALL(*mock_homedir_methods_, AddKeyEx(_, _, _, _, _)).Times(1);
JSEval("$('supervised-user-creation-next-button').click()");
+ mount_wait_loop.Run();
+ add_key_wait_loop.Run();
testing::Mock::VerifyAndClearExpectations(mock_homedir_methods_);
+ mock_homedir_methods_->set_mount_callback(base::Closure());
+ mock_homedir_methods_->set_add_key_callback(base::Closure());
EXPECT_TRUE(registration_utility_stub_->register_was_called());
EXPECT_EQ(registration_utility_stub_->display_name(),
@@ -182,6 +190,9 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserTransactionCleanupTest,
// We wait for token now. Press cancel button at this point.
JSEvalOrExitBrowser("$('supervised-user-creation').cancel()");
+
+ // TODO(achuith): There should probably be a wait for a specific event.
+ content::RunAllPendingInMessageLoop();
}
IN_PROC_BROWSER_TEST_(

Powered by Google App Engine
This is Rietveld 408576698