| 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 "ui/views/mus/views_mus_test_suite.h" | 5 #include "ui/views/mus/views_mus_test_suite.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 base::WaitableEvent::InitialState::NOT_SIGNALED); | 91 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 92 thread_.task_runner()->PostTask( | 92 thread_.task_runner()->PostTask( |
| 93 FROM_HERE, base::Bind(&ShellConnection::TearDownConnections, | 93 FROM_HERE, base::Bind(&ShellConnection::TearDownConnections, |
| 94 base::Unretained(this), &wait)); | 94 base::Unretained(this), &wait)); |
| 95 wait.Wait(); | 95 wait.Wait(); |
| 96 } | 96 } |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 shell::Connector* GetConnector() { | 99 shell::Connector* GetConnector() { |
| 100 shell_connector_.reset(); | 100 shell_connector_.reset(); |
| 101 base::WaitableEvent wait(false, false); | 101 base::WaitableEvent wait(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| 102 base::WaitableEvent::InitialState::NOT_SIGNALED); |
| 102 thread_.task_runner()->PostTask(FROM_HERE, | 103 thread_.task_runner()->PostTask(FROM_HERE, |
| 103 base::Bind(&ShellConnection::CloneConnector, | 104 base::Bind(&ShellConnection::CloneConnector, |
| 104 base::Unretained(this), &wait)); | 105 base::Unretained(this), &wait)); |
| 105 wait.Wait(); | 106 wait.Wait(); |
| 106 DCHECK(shell_connector_); | 107 DCHECK(shell_connector_); |
| 107 return shell_connector_.get(); | 108 return shell_connector_.get(); |
| 108 } | 109 } |
| 109 | 110 |
| 110 void CloneConnector(base::WaitableEvent* wait) { | 111 void CloneConnector(base::WaitableEvent* wait) { |
| 111 shell_connector_ = shell_connection_->connector()->Clone(); | 112 shell_connector_ = shell_connection_->connector()->Clone(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 ViewsTestSuite::Initialize(); | 168 ViewsTestSuite::Initialize(); |
| 168 shell_connections_.reset(new ShellConnection); | 169 shell_connections_.reset(new ShellConnection); |
| 169 } | 170 } |
| 170 | 171 |
| 171 void ViewsMusTestSuite::Shutdown() { | 172 void ViewsMusTestSuite::Shutdown() { |
| 172 shell_connections_.reset(); | 173 shell_connections_.reset(); |
| 173 ViewsTestSuite::Shutdown(); | 174 ViewsTestSuite::Shutdown(); |
| 174 } | 175 } |
| 175 | 176 |
| 176 } // namespace views | 177 } // namespace views |
| OLD | NEW |