blob: fe52eabb171dafb6e3e0a810d1055f80f80539ed [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "peridot/lib/testing/fake_application_launcher.h"
namespace modular {
namespace testing {
void FakeApplicationLauncher::CreateApplication(
component::ApplicationLaunchInfo launch_info,
fidl::InterfaceRequest<component::ApplicationController> controller) {
auto it = connectors_.find(launch_info.url);
if (it != connectors_.end()) {
it->second(std::move(launch_info), std::move(controller));
}
}
void FakeApplicationLauncher::RegisterApplication(
std::string url,
ApplicationConnectorFn connector) {
connectors_[url] = connector;
}
} // namespace testing
} // namespace modular