OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "services/shell/public/cpp/service_test.h" | 5 #include "services/shell/public/cpp/service_test.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "services/shell/background/background_shell.h" | 10 #include "services/shell/background/background_shell.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 background_shell_.reset(new shell::BackgroundShell); | 56 background_shell_.reset(new shell::BackgroundShell); |
57 background_shell_->Init(nullptr); | 57 background_shell_->Init(nullptr); |
58 | 58 |
59 // Create the shell connection. We don't proceed until we get our | 59 // Create the shell connection. We don't proceed until we get our |
60 // Service's OnStart() method is called. | 60 // Service's OnStart() method is called. |
61 base::RunLoop run_loop; | 61 base::RunLoop run_loop; |
62 base::MessageLoop::ScopedNestableTaskAllower allow( | 62 base::MessageLoop::ScopedNestableTaskAllower allow( |
63 base::MessageLoop::current()); | 63 base::MessageLoop::current()); |
64 initialize_called_ = run_loop.QuitClosure(); | 64 initialize_called_ = run_loop.QuitClosure(); |
65 | 65 |
66 shell_connection_.reset(new ShellConnection( | 66 service_context_.reset(new ServiceContext( |
67 service_.get(), | 67 service_.get(), |
68 background_shell_->CreateServiceRequest(test_name_))); | 68 background_shell_->CreateServiceRequest(test_name_))); |
69 connector_ = shell_connection_->connector(); | 69 connector_ = service_context_->connector(); |
70 | 70 |
71 run_loop.Run(); | 71 run_loop.Run(); |
72 } | 72 } |
73 | 73 |
74 void ServiceTest::TearDown() { | 74 void ServiceTest::TearDown() { |
75 shell_connection_.reset(); | 75 service_context_.reset(); |
76 background_shell_.reset(); | 76 background_shell_.reset(); |
77 message_loop_.reset(); | 77 message_loop_.reset(); |
78 service_.reset(); | 78 service_.reset(); |
79 } | 79 } |
80 | 80 |
81 } // namespace test | 81 } // namespace test |
82 } // namespace shell | 82 } // namespace shell |
OLD | NEW |