| Index: shell/child_process_host_unittest.cc
|
| diff --git a/shell/app_child_process_host_unittest.cc b/shell/child_process_host_unittest.cc
|
| similarity index 70%
|
| rename from shell/app_child_process_host_unittest.cc
|
| rename to shell/child_process_host_unittest.cc
|
| index f627c24c1368d4c59c0d6a6cc31808a414455955..ac2fd365c39954d1db858214102e740de1d1d08c 100644
|
| --- a/shell/app_child_process_host_unittest.cc
|
| +++ b/shell/child_process_host_unittest.cc
|
| @@ -4,7 +4,7 @@
|
|
|
| // Note: This file also tests app_child_process.*.
|
|
|
| -#include "shell/app_child_process_host.h"
|
| +#include "shell/child_process_host.h"
|
|
|
| #include "base/logging.h"
|
| #include "base/macros.h"
|
| @@ -20,20 +20,19 @@ namespace shell {
|
| namespace {
|
|
|
| // Subclass just so we can observe |DidStart()|.
|
| -class TestAppChildProcessHost : public AppChildProcessHost {
|
| +class TestChildProcessHost : public ChildProcessHost {
|
| public:
|
| - explicit TestAppChildProcessHost(Context* context)
|
| - : AppChildProcessHost(context) {}
|
| - ~TestAppChildProcessHost() override {}
|
| + explicit TestChildProcessHost(Context* context) : ChildProcessHost(context) {}
|
| + ~TestChildProcessHost() override {}
|
|
|
| void DidStart(bool success) override {
|
| EXPECT_TRUE(success);
|
| - AppChildProcessHost::DidStart(success);
|
| + ChildProcessHost::DidStart(success);
|
| base::MessageLoop::current()->QuitWhenIdle();
|
| }
|
|
|
| private:
|
| - DISALLOW_COPY_AND_ASSIGN(TestAppChildProcessHost);
|
| + DISALLOW_COPY_AND_ASSIGN(TestChildProcessHost);
|
| };
|
|
|
| #if defined(OS_ANDROID)
|
| @@ -44,16 +43,16 @@ class TestAppChildProcessHost : public AppChildProcessHost {
|
| #endif // defined(OS_ANDROID)
|
| // Just tests starting the child process and joining it (without starting an
|
| // app).
|
| -TEST(AppChildProcessHostTest, MAYBE_StartJoin) {
|
| +TEST(ChildProcessHostTest, MAYBE_StartJoin) {
|
| Context context;
|
| base::MessageLoop message_loop(
|
| scoped_ptr<base::MessagePump>(new common::MessagePumpMojo()));
|
| context.Init();
|
| - TestAppChildProcessHost app_child_process_host(&context);
|
| - app_child_process_host.Start();
|
| + TestChildProcessHost child_process_host(&context);
|
| + child_process_host.Start();
|
| message_loop.Run(); // This should run until |DidStart()|.
|
| - app_child_process_host.ExitNow(123);
|
| - int exit_code = app_child_process_host.Join();
|
| + child_process_host.ExitNow(123);
|
| + int exit_code = child_process_host.Join();
|
| VLOG(2) << "Joined child: exit_code = " << exit_code;
|
| EXPECT_EQ(123, exit_code);
|
|
|
| @@ -68,31 +67,30 @@ TEST(AppChildProcessHostTest, MAYBE_StartJoin) {
|
| #endif // defined(OS_ANDROID)
|
| // Tests that even on connection error, the callback to |StartApp()| will get
|
| // called.
|
| -TEST(AppChildProcessHostTest, MAYBE_ConnectionError) {
|
| +TEST(ChildProcessHostTest, MAYBE_ConnectionError) {
|
| Context context;
|
| base::MessageLoop message_loop(
|
| scoped_ptr<base::MessagePump>(new common::MessagePumpMojo()));
|
| context.Init();
|
| - TestAppChildProcessHost app_child_process_host(&context);
|
| - app_child_process_host.Start();
|
| + TestChildProcessHost child_process_host(&context);
|
| + child_process_host.Start();
|
| message_loop.Run(); // This should run until |DidStart()|.
|
| // Send |ExitNow()| first, so that the |StartApp()| below won't actually be
|
| // processed, and we'll just get a connection error.
|
| - app_child_process_host.ExitNow(123);
|
| + child_process_host.ExitNow(123);
|
| MessagePipe mp;
|
| InterfaceRequest<Application> application_request;
|
| application_request.Bind(mp.handle0.Pass());
|
| // This won't actually be called, but the callback should be run.
|
| MojoResult result = MOJO_RESULT_INTERNAL;
|
| - app_child_process_host.StartApp(
|
| - "/does_not_exist/cbvgyuio", false, application_request.Pass(),
|
| - [&result](int32_t r) {
|
| - result = r;
|
| - base::MessageLoop::current()->QuitWhenIdle();
|
| - });
|
| + child_process_host.StartApp("/does_not_exist/cbvgyuio", false,
|
| + application_request.Pass(), [&result](int32_t r) {
|
| + result = r;
|
| + base::MessageLoop::current()->QuitWhenIdle();
|
| + });
|
| message_loop.Run();
|
| EXPECT_EQ(MOJO_RESULT_UNKNOWN, result);
|
| - int exit_code = app_child_process_host.Join();
|
| + int exit_code = child_process_host.Join();
|
| VLOG(2) << "Joined child: exit_code = " << exit_code;
|
| EXPECT_EQ(123, exit_code);
|
|
|
|
|