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

Unified Diff: mojo/shell/public/cpp/lib/shell_test.cc

Issue 1814983002: Convert filesystem_apptests to shelltests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Also delete references to the old apptests Created 4 years, 9 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 | « components/filesystem/test_manifest.json ('k') | mojo/shell/public/cpp/shell_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/shell_test.cc
diff --git a/mojo/shell/public/cpp/lib/shell_test.cc b/mojo/shell/public/cpp/lib/shell_test.cc
index e5cb3c2edb822e6b922836e9e867bf49433676a0..605e7c59b1b3f2b951e8bf719f2d4cb0dc76b0f1 100644
--- a/mojo/shell/public/cpp/lib/shell_test.cc
+++ b/mojo/shell/public/cpp/lib/shell_test.cc
@@ -5,6 +5,7 @@
#include "mojo/shell/public/cpp/shell_test.h"
#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
#include "mojo/shell/background/background_shell.h"
#include "mojo/shell/public/cpp/shell_client.h"
@@ -44,6 +45,7 @@ void ShellTest::InitializeCalled(Connector* connector,
initialize_name_ = name;
initialize_instance_id_ = id;
initialize_userid_ = user_id;
+ initialize_called_.Run();
}
void ShellTest::SetUp() {
@@ -51,10 +53,20 @@ void ShellTest::SetUp() {
message_loop_ = CreateMessageLoop();
background_shell_.reset(new shell::BackgroundShell);
background_shell_->Init(nullptr);
+
+ // Create the shell connection. We don't proceed until we get our
+ // ShellClient's Initialize() method is called.
+ base::RunLoop run_loop;
+ base::MessageLoop::ScopedNestableTaskAllower allow(
+ base::MessageLoop::current());
+ initialize_called_ = run_loop.QuitClosure();
+
shell_connection_.reset(new ShellConnection(
shell_client_.get(),
background_shell_->CreateShellClientRequest(test_name_)));
connector_ = shell_connection_->connector();
+
+ run_loop.Run();
}
void ShellTest::TearDown() {
« no previous file with comments | « components/filesystem/test_manifest.json ('k') | mojo/shell/public/cpp/shell_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698