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

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: Spin the loop in PRE_CreateAndCancelSupervisedUser. Created 4 years, 1 month 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..5f2672a16d395a9f09a96c5311ab3d2b99b5a08c 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;
+ 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()");
+
+ // FIXME: There should probably be a wait for a specific event.
nasko 2016/11/30 17:38:56 TODO(): ....
Alexander Semashko 2016/11/30 22:23:08 Done.
+ content::RunAllPendingInMessageLoop();
}
IN_PROC_BROWSER_TEST_(

Powered by Google App Engine
This is Rietveld 408576698