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

Unified Diff: mojo/shell/shell_test_base.h

Issue 314293002: Mojo: Add a trivial end-to-end (in-process) test of Mojo shell. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comments Created 6 years, 6 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 | « mojo/services/test_service/test_service_impl.cc ('k') | mojo/shell/shell_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/shell_test_base.h
diff --git a/mojo/shell/shell_test_base.h b/mojo/shell/shell_test_base.h
index afaf27c1e973cd95c634d6f7cfb14fe856bc5b26..639a0a7c144c051d1f8d1b31942936d1d53853c8 100644
--- a/mojo/shell/shell_test_base.h
+++ b/mojo/shell/shell_test_base.h
@@ -5,13 +5,25 @@
#ifndef MOJO_SHELL_SHELL_TEST_BASE_H_
#define MOJO_SHELL_SHELL_TEST_BASE_H_
-#include "base/at_exit.h"
+#include <string>
+
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "mojo/public/cpp/environment/environment.h"
+#include "mojo/public/cpp/system/core.h"
#include "testing/gtest/include/gtest/gtest.h"
+class GURL;
+
+namespace base {
+class MessageLoop;
+}
+
namespace mojo {
namespace shell {
+
+class Context;
+
namespace test {
class ShellTestBase : public testing::Test {
@@ -19,15 +31,31 @@ class ShellTestBase : public testing::Test {
ShellTestBase();
virtual ~ShellTestBase();
+ // Should be called before any of the methods below are called.
+ void InitMojo();
+
+ // Launches the given service in-process; |service_url| should typically be a
+ // mojo: URL (the origin will be set to an "appropriate" file: URL).
+ void LaunchServiceInProcess(const GURL& service_url,
+ const std::string& service_name,
+ ScopedMessagePipeHandle client_handle);
+
+ base::MessageLoop* message_loop() { return message_loop_.get(); }
+ Context* shell_context() { return shell_context_.get(); }
+
private:
- base::ShadowingAtExitManager at_exit_manager_;
Environment environment_;
+ // Only set if/when |InitMojo()| is called.
+ scoped_ptr<base::MessageLoop> message_loop_;
+ scoped_ptr<Context> shell_context_;
+
DISALLOW_COPY_AND_ASSIGN(ShellTestBase);
};
} // namespace test
+
} // namespace shell
} // namespace mojo
-#endif // MOJO_SYSTEM_SHELL_SHELLASE_H_
+#endif // MOJO_SHELL_SHELL_TEST_BASE_H_
« no previous file with comments | « mojo/services/test_service/test_service_impl.cc ('k') | mojo/shell/shell_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698