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

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: Address comments. 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..c9fbed8acbcba4828fcb1c757aafb87457562756 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,19 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserTransactionCleanupTest,
StartFlowLoginAsManager();
FillNewUserData(kTestSupervisedUserDisplayName);
+ base::RunLoop mount_wait_loop, 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 +189,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