OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/shell/shell_test_helper.h" | 5 #include "mojo/shell/shell_test_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "mojo/shell/context.h" | 10 #include "mojo/shell/context.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 } // namespace | 34 } // namespace |
35 | 35 |
36 class ShellTestHelper::TestShellClient : public ShellClient { | 36 class ShellTestHelper::TestShellClient : public ShellClient { |
37 public: | 37 public: |
38 TestShellClient() {} | 38 TestShellClient() {} |
39 virtual ~TestShellClient() {} | 39 virtual ~TestShellClient() {} |
40 | 40 |
41 // ShellClient: | 41 // ShellClient: |
42 virtual void AcceptConnection( | 42 virtual void AcceptConnection( |
43 const mojo::String& url, | 43 String url, ScopedMessagePipeHandle client_handle) OVERRIDE { |
44 ScopedMessagePipeHandle client_handle) OVERRIDE { | |
45 } | 44 } |
46 | 45 |
47 private: | 46 private: |
48 DISALLOW_COPY_AND_ASSIGN(TestShellClient); | 47 DISALLOW_COPY_AND_ASSIGN(TestShellClient); |
49 }; | 48 }; |
50 | 49 |
51 ShellTestHelper::ShellTestHelper() | 50 ShellTestHelper::ShellTestHelper() |
52 : shell_thread_("shell_test_helper"), | 51 : shell_thread_("shell_test_helper"), |
53 state_(NULL) { | 52 state_(NULL) { |
54 CommandLine::Init(0, NULL); | 53 CommandLine::Init(0, NULL); |
(...skipping 24 matching lines...) Expand all Loading... |
79 void ShellTestHelper::OnShellStarted() { | 78 void ShellTestHelper::OnShellStarted() { |
80 DCHECK(state_); | 79 DCHECK(state_); |
81 shell_client_.reset(new TestShellClient); | 80 shell_client_.reset(new TestShellClient); |
82 shell_.Bind(state_->shell_handle.Pass()); | 81 shell_.Bind(state_->shell_handle.Pass()); |
83 shell_->SetClient(shell_client_.get()); | 82 shell_->SetClient(shell_client_.get()); |
84 run_loop_->Quit(); | 83 run_loop_->Quit(); |
85 } | 84 } |
86 | 85 |
87 } // namespace shell | 86 } // namespace shell |
88 } // namespace mojo | 87 } // namespace mojo |
OLD | NEW |