| |
| |
| |
|
|
| #include "chromeos/services/machine_learning/public/cpp/service_connection.h" |
|
|
| namespace chromeos { |
| namespace machine_learning { |
|
|
| namespace { |
| static ServiceConnection* g_fake_service_connection_for_testing = nullptr; |
| } |
|
|
| ServiceConnection* ServiceConnection::GetInstance() { |
| if (g_fake_service_connection_for_testing) { |
| return g_fake_service_connection_for_testing; |
| } |
|
|
| |
| |
| return CreateRealInstance(); |
| } |
|
|
| void ServiceConnection::UseFakeServiceConnectionForTesting( |
| ServiceConnection* const fake_service_connection) { |
| g_fake_service_connection_for_testing = fake_service_connection; |
| } |
|
|
| } |
| } |
|
|