Commit afa5084d authored by Kyle Williams's avatar Kyle Williams Committed by Commit Bot

cfm: Add a convenience class for connecting to the |CfmServiceContext|

Adds both the convenience class for creating new services for the
|CfMServiceContext| as well as the nominal primary mojom broker service
|mojom::CfmBrowser|. This class indicates to |CfmServiceContext| the
lifespan of chromium.

BUG=chromium:1105567, b:165864612
TEST=`autoninja -C out/Default/ chrome/test:unit_tests && \
     xvfb-run ./out/Default/unit_tests --gtest_filter=CfmServiceAdaptorTest.*`

Cq-Depend: chromium:2419799, chromium:2436990
Change-Id: I754cfa99e5137b792204789b4f4847bd19e7536c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2429424
Commit-Queue: Kyle Williams <kdgwill@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Reviewed-by: default avatarKen Rockot <rockot@google.com>
Reviewed-by: default avatarMattias Nissler <mnissler@chromium.org>
Auto-Submit: Kyle Williams <kdgwill@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814757}
parent 6c2b1efa
......@@ -3879,6 +3879,9 @@ source_set("unit_tests") {
if (use_udev) {
deps += [ "//device/udev_linux:test_support" ]
}
if (is_cfm) {
deps += [ "//chrome/browser/chromeos/cfm:unit_tests" ]
}
data = [ "//chromeos/test/data/" ]
}
......
......@@ -9,13 +9,48 @@ assert(is_cfm, "Non-CfM builds cannot depend on this library")
source_set("cfm") {
sources = [
"cfm_browser_service.cc",
"cfm_browser_service.h",
"cfm_chrome_services.cc",
"cfm_chrome_services.h",
"service_adaptor.cc",
"service_adaptor.h",
]
deps = [
"//chromeos/dbus/cfm",
"//chromeos/services/cfm/public/features",
"//chromeos/services/cfm/public/mojom",
]
public_deps = [ "//base" ]
public_deps = [
"//base",
"//chromeos/dbus/cfm",
]
}
source_set("test_support") {
testonly = true
sources = [
"fake_service_context.cc",
"fake_service_context.h",
]
deps = [
":cfm",
"//base",
"//chromeos/dbus/cfm",
"//chromeos/services/cfm/public/mojom",
"//mojo/public/cpp/bindings",
]
}
source_set("unit_tests") {
testonly = true
sources = [ "service_adaptor_unittest.cc" ]
deps = [
":cfm",
":test_support",
"//base/test:test_support",
"//chromeos/services/cfm/public/cpp:test_support",
"//mojo/core/embedder",
"//mojo/public/cpp/bindings",
"//testing/gtest",
]
}
// Copyright 2020 The Chromium 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 "chrome/browser/chromeos/cfm/cfm_browser_service.h"
#include "base/bind.h"
#include "base/macros.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
namespace chromeos {
namespace cfm {
CfmBrowserService::CfmBrowserService()
: service_adaptor_(mojom::CfmBrowser::Name_, this) {
receivers_.set_disconnect_handler(base::BindRepeating(
&CfmBrowserService::OnServiceDisconnect, base::Unretained(this)));
}
CfmBrowserService::~CfmBrowserService() = default;
bool CfmBrowserService::ServiceRequestReceived(const std::string& service_id) {
if (service_id != mojom::CfmBrowser::Name_) {
return false;
}
service_adaptor_.BindServiceAdaptor();
return true;
}
void CfmBrowserService::OnAdaptorConnect(bool success) {
VLOG_IF(3, success) << "mojom::CfmBrowser Service Adaptor is connected";
}
void CfmBrowserService::OnAdaptorDisconnect() {
LOG(ERROR) << "mojom::CfmBrowser Service Adaptor has been disconnected";
// CleanUp to follow the lifecycle of the primary CfmServiceContext
receivers_.Clear();
}
void CfmBrowserService::BindService(
::mojo::ScopedMessagePipeHandle receiver_pipe) {
receivers_.Add(
this, mojo::PendingReceiver<mojom::CfmBrowser>(std::move(receiver_pipe)));
}
void CfmBrowserService::OnServiceDisconnect() {
VLOG(3) << "mojom::CfmBrowser disconnected";
}
CfmBrowserService* CfmBrowserService::GetInstance() {
static base::NoDestructor<CfmBrowserService> cfm_browser_service;
return cfm_browser_service.get();
}
} // namespace cfm
} // namespace chromeos
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_CFM_CFM_BROWSER_SERVICE_H_
#define CHROME_BROWSER_CHROMEOS_CFM_CFM_BROWSER_SERVICE_H_
#include "base/memory/weak_ptr.h"
#include "base/no_destructor.h"
#include "chrome/browser/chromeos/cfm/service_adaptor.h"
#include "chromeos/dbus/cfm/cfm_observer.h"
#include "chromeos/services/cfm/public/mojom/cfm_browser.mojom.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
namespace chromeos {
namespace cfm {
// Implementation of the CfmBrowser Service.
// The lifespan of this service is indicative of the lifespan of chrome browser
// process, allowing |CfmServiceContext| to rebuild its IPC graph if required.
class CfmBrowserService : public CfmObserver,
public ServiceAdaptor::Delegate,
public mojom::CfmBrowser {
public:
CfmBrowserService(const CfmBrowserService&) = delete;
CfmBrowserService& operator=(const CfmBrowserService&) = delete;
~CfmBrowserService() override;
// Returns the global instance
static CfmBrowserService* GetInstance();
protected:
friend class base::NoDestructor<CfmBrowserService>;
CfmBrowserService();
// Forward |CfmObserver| implementation
bool ServiceRequestReceived(const std::string& interface_name) override;
// Forward |ServiceAdaptorDelegate| implementation
void OnAdaptorConnect(bool success) override;
void OnAdaptorDisconnect() override;
void BindService(::mojo::ScopedMessagePipeHandle receiver_pipe) override;
virtual void OnServiceDisconnect();
private:
ServiceAdaptor service_adaptor_;
mojo::ReceiverSet<mojom::CfmBrowser> receivers_;
};
} // namespace cfm
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_CFM_CFM_BROWSER_SERVICE_H_
......@@ -4,6 +4,7 @@
#include "chrome/browser/chromeos/cfm/cfm_chrome_services.h"
#include "chrome/browser/chromeos/cfm/cfm_browser_service.h"
#include "chromeos/dbus/cfm/cfm_hotline_client.h"
#include "chromeos/services/cfm/public/features/features.h"
......@@ -17,7 +18,7 @@ void InitializeCfmServices() {
return;
}
// TODO(kdgwill) Add Initial CfM Chromium Service
CfmHotlineClient::Get()->AddObserver(CfmBrowserService::GetInstance());
}
} // namespace cfm
......
// Copyright 2020 The Chromium 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 "chrome/browser/chromeos/cfm/fake_service_context.h"
namespace chromeos {
namespace cfm {
FakeCfmServiceContext::FakeCfmServiceContext() = default;
FakeCfmServiceContext::~FakeCfmServiceContext() = default;
void FakeCfmServiceContext::ProvideAdaptor(
const std::string& interface_name,
mojo::PendingRemote<mojom::CfmServiceAdaptor> adaptor_remote,
ProvideAdaptorCallback callback) {
std::move(provide_adaptor_callback_)
.Run(std::move(interface_name), std::move(adaptor_remote),
std::move(callback));
}
void FakeCfmServiceContext::BindRegistry(
const std::string& interface_name,
mojo::PendingReceiver<mojom::CfmServiceRegistry> broker_receiver,
BindRegistryCallback callback) {
std::move(bind_registry_callback_)
.Run(std::move(interface_name), std::move(broker_receiver),
std::move(callback));
}
void FakeCfmServiceContext::SetFakeProvideAdaptorCallback(
FakeProvideAdaptorCallback callback) {
provide_adaptor_callback_ = std::move(callback);
}
void FakeCfmServiceContext::SetFakeBindRegistryCallback(
FakeBindRegistryCallback callback) {
bind_registry_callback_ = std::move(callback);
}
} // namespace cfm
} // namespace chromeos
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_CFM_FAKE_SERVICE_CONTEXT_H_
#define CHROME_BROWSER_CHROMEOS_CFM_FAKE_SERVICE_CONTEXT_H_
#include "base/bind.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "chromeos/services/cfm/public/mojom/cfm_service_manager.mojom.h"
namespace chromeos {
namespace cfm {
class FakeCfmServiceContext : public mojom::CfmServiceContext {
public:
using FakeProvideAdaptorCallback = base::OnceCallback<void(
const std::string& interface_name,
mojo::PendingRemote<mojom::CfmServiceAdaptor> adaptor_remote,
ProvideAdaptorCallback callback)>;
using FakeBindRegistryCallback = base::OnceCallback<void(
const std::string& interface_name,
mojo::PendingReceiver<mojom::CfmServiceRegistry> broker_receiver,
BindRegistryCallback callback)>;
FakeCfmServiceContext();
FakeCfmServiceContext(const FakeCfmServiceContext&) = delete;
FakeCfmServiceContext& operator=(const FakeCfmServiceContext&) = delete;
~FakeCfmServiceContext() override;
void ProvideAdaptor(
const std::string& interface_name,
mojo::PendingRemote<mojom::CfmServiceAdaptor> adaptor_remote,
ProvideAdaptorCallback callback) override;
void BindRegistry(
const std::string& interface_name,
mojo::PendingReceiver<mojom::CfmServiceRegistry> broker_receiver,
BindRegistryCallback callback) override;
void SetFakeProvideAdaptorCallback(FakeProvideAdaptorCallback callback);
void SetFakeBindRegistryCallback(FakeBindRegistryCallback callback);
private:
FakeProvideAdaptorCallback provide_adaptor_callback_;
FakeBindRegistryCallback bind_registry_callback_;
};
} // namespace cfm
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_CFM_FAKE_SERVICE_CONTEXT_H_
// Copyright 2020 The Chromium 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 "chrome/browser/chromeos/cfm/service_adaptor.h"
#include "chromeos/services/cfm/public/cpp/service_connection.h"
namespace chromeos {
namespace cfm {
ServiceAdaptor::ServiceAdaptor(std::string interface_name, Delegate* delegate)
: interface_name_(std::move(interface_name)), delegate_(delegate) {
DCHECK(delegate_);
}
ServiceAdaptor::~ServiceAdaptor() = default;
mojom::CfmServiceContext* ServiceAdaptor::GetContext() {
if (!context_.is_bound()) {
ServiceConnection::GetInstance()->BindServiceContext(
context_.BindNewPipeAndPassReceiver());
context_.reset_on_disconnect();
}
return context_.get();
}
void ServiceAdaptor::BindServiceAdaptor() {
if (adaptor_.is_bound()) {
return;
}
GetContext()->ProvideAdaptor(interface_name_,
adaptor_.BindNewPipeAndPassRemote(),
base::BindOnce(&ServiceAdaptor::OnAdaptorConnect,
weak_ptr_factory_.GetWeakPtr()));
adaptor_.set_disconnect_handler(base::BindOnce(
&ServiceAdaptor::OnAdaptorDisconnect, base::Unretained(this)));
}
void ServiceAdaptor::BindService(mojo::ScopedMessagePipeHandle receiver_pipe) {
delegate_->BindService(std::move(receiver_pipe));
}
void ServiceAdaptor::OnAdaptorConnect(bool success) {
DLOG_IF(WARNING, !success) << "Failed Registration for " << interface_name_;
if (!success) {
// If the connection to |CfmServiceContext| is unsuccessful reset the
// adaptor to allow for future attempts.
adaptor_.reset();
}
delegate_->OnAdaptorConnect(success);
}
void ServiceAdaptor::OnAdaptorDisconnect() {
adaptor_.reset();
delegate_->OnAdaptorDisconnect();
}
} // namespace cfm
} // namespace chromeos
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_CHROMEOS_CFM_SERVICE_ADAPTOR_H_
#define CHROME_BROWSER_CHROMEOS_CFM_SERVICE_ADAPTOR_H_
#include "chromeos/services/cfm/public/mojom/cfm_service_manager.mojom.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
namespace chromeos {
namespace cfm {
// Abstract class that provides convience methods, allowing new CfM Services to
// register with the |CfmServiceContext|.
class ServiceAdaptor : public mojom::CfmServiceAdaptor {
public:
class Delegate {
public:
Delegate(const Delegate&) = delete;
Delegate& operator=(const Delegate&) = delete;
virtual ~Delegate() = default;
// Called when the Service Adaptor has successfully connected to the
// |mojom::CfmServiceContext|
virtual void OnAdaptorConnect(bool success) = 0;
// Called if the mojom connection to the primary |mojom::CfmServiceContext|
// is disrupted.
virtual void OnAdaptorDisconnect() = 0;
// Called when attempting to Bind a mojom using using a message pipe of the
// given types PendingReceiver.
virtual void BindService(mojo::ScopedMessagePipeHandle receiver_pipe) = 0;
protected:
Delegate() = default;
};
ServiceAdaptor(std::string interface_name, Delegate* delegate);
ServiceAdaptor(const ServiceAdaptor&) = delete;
ServiceAdaptor& operator=(const ServiceAdaptor&) = delete;
~ServiceAdaptor() override;
// Returns the primary |mojom::CfmServiceContext|
virtual mojom::CfmServiceContext* GetContext();
// Binds a |mojo::Remote| to the primary |mojom::CfmServiceContext|
virtual void BindServiceAdaptor();
protected:
// Forward |mojom::CfmServiceAdaptor| implementation
void BindService(mojo::ScopedMessagePipeHandle receiver_pipe) override;
// Called when the Service Adaptor has successfully connected to the
// |mojom::CfmServiceContext|
virtual void OnAdaptorConnect(bool success);
// Called if the mojom connection to the primary |mojom::CfmServiceContext| is
// disrupted.
virtual void OnAdaptorDisconnect();
private:
// Name of the mojom interface (i.e Interface::Name_) this service adaptor is
// proxying bind request for.
const std::string interface_name_;
Delegate* const delegate_;
mojo::Remote<mojom::CfmServiceContext> context_;
mojo::Receiver<mojom::CfmServiceAdaptor> adaptor_{this};
base::WeakPtrFactory<ServiceAdaptor> weak_ptr_factory_{this};
};
} // namespace cfm
} // namespace chromeos
#endif // CHROME_BROWSER_CHROMEOS_CFM_SERVICE_ADAPTOR_H_
// Copyright 2020 The Chromium 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 "chrome/browser/chromeos/cfm/service_adaptor.h"
#include <utility>
#include <vector>
#include "base/bind.h"
#include "base/macros.h"
#include "base/optional.h"
#include "base/run_loop.h"
#include "base/test/bind_test_util.h"
#include "base/test/mock_callback.h"
#include "base/test/task_environment.h"
#include "chrome/browser/chromeos/cfm/cfm_browser_service.h"
#include "chrome/browser/chromeos/cfm/fake_service_context.h"
#include "chromeos/dbus/cfm/cfm_hotline_client.h"
#include "chromeos/services/cfm/public/cpp/fake_service_connection.h"
#include "chromeos/services/cfm/public/cpp/service_connection.h"
#include "chromeos/services/cfm/public/mojom/cfm_service_manager.mojom.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
using ::testing::_;
using ::testing::Invoke;
using ::testing::Return;
using ::testing::StrictMock;
using ::testing::WithArgs;
namespace chromeos {
namespace cfm {
namespace {
class FakeDelegate : public ServiceAdaptor::Delegate {
public:
void OnAdaptorConnect(bool success) override {
connect_count++;
connect_callback_.Run();
}
void OnAdaptorDisconnect() override {
disconnect_count++;
disconnect_callback_.Run();
}
void BindService(mojo::ScopedMessagePipeHandle) override {
bind_request_count++;
bind_service_callback_.Run();
}
int connect_count = 0;
int disconnect_count = 0;
int bind_request_count = 0;
base::Closure connect_callback_;
base::Closure disconnect_callback_;
base::Closure bind_service_callback_;
};
class CfmServiceAdaptorTest : public testing::Test {
public:
CfmServiceAdaptorTest() = default;
CfmServiceAdaptorTest(const CfmServiceAdaptorTest&) = delete;
CfmServiceAdaptorTest& operator=(const CfmServiceAdaptorTest&) = delete;
void SetUp() override {
CfmHotlineClient::InitializeFake();
ServiceConnection::UseFakeServiceConnectionForTesting(
&fake_service_connection);
}
void TearDown() override { CfmHotlineClient::Shutdown(); }
void SetCallback(FakeServiceConnectionImpl::FakeBootstrapCallback callback) {
fake_service_connection.SetCallback(std::move(callback));
}
private:
base::test::SingleThreadTaskEnvironment task_environment_;
FakeServiceConnectionImpl fake_service_connection;
};
TEST_F(CfmServiceAdaptorTest, BindServiceAdaptor) {
base::RunLoop run_loop;
// Intercept Connection to |CfmServiceContext|
FakeCfmServiceContext fake_context;
mojo::Receiver<mojom::CfmServiceContext> context_receiver(&fake_context);
SetCallback(base::BindLambdaForTesting(
[&context_receiver](
mojo::PendingReceiver<mojom::CfmServiceContext> pending_receiver,
bool success) {
// Bind the Context Receiver to the mock
context_receiver.Bind(std::move(pending_receiver));
}));
// Fake out the next call to provide adaptor
mojo::Remote<mojom::CfmServiceAdaptor> remote;
fake_context.SetFakeProvideAdaptorCallback(base::BindLambdaForTesting(
[&](const std::string& interface_name,
mojo::PendingRemote<mojom::CfmServiceAdaptor> pending_adaptor,
FakeCfmServiceContext::ProvideAdaptorCallback callback) {
// Bind the |mojom::CfmServiceAdaptor| to a Remote
remote.Bind(std::move(pending_adaptor));
std::move(callback).Run(true);
}));
FakeDelegate fake_delegate;
fake_delegate.connect_callback_ = base::BindLambdaForTesting([&] {
// Force call to disconnect handler
remote.reset();
});
fake_delegate.disconnect_callback_ = run_loop.QuitClosure();
// Initiate Test
ServiceAdaptor adaptor("foo", &fake_delegate);
adaptor.BindServiceAdaptor();
run_loop.Run();
EXPECT_EQ(fake_delegate.connect_count, 1);
EXPECT_EQ(fake_delegate.disconnect_count, 1);
}
} // namespace
} // namespace cfm
} // namespace chromeos
......@@ -9,6 +9,7 @@
#include "base/macros.h"
#include "base/no_destructor.h"
#include "base/sequence_checker.h"
#include "chromeos/dbus/cfm/cfm_hotline_client.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/platform/platform_channel.h"
#include "mojo/public/cpp/system/invitation.h"
......@@ -21,18 +22,18 @@ FakeServiceConnectionImpl::~FakeServiceConnectionImpl() = default;
// Bind to the CfM Service Context Daemon
void FakeServiceConnectionImpl::BindServiceContext(
mojo::PendingReceiver<mojom::CfmServiceContext> receiver) {
mojo::PendingReceiver<mojom::CfmServiceContext> pending_receiver) {
CfmHotlineClient::Get()->WaitForServiceToBeAvailable(
base::BindOnce(&FakeServiceConnectionImpl::CfMContextServiceStarted,
base::Unretained(this), std::move(receiver)));
base::Unretained(this), std::move(pending_receiver)));
}
void FakeServiceConnectionImpl::CfMContextServiceStarted(
mojo::PendingReceiver<mojom::CfmServiceContext> receiver,
mojo::PendingReceiver<mojom::CfmServiceContext> pending_receiver,
bool is_available) {
if (!is_available || callback_.is_null()) {
receiver.reset();
std::move(callback_).Run(false);
pending_receiver.reset();
std::move(callback_).Run(std::move(pending_receiver), false);
return;
}
......@@ -42,7 +43,8 @@ void FakeServiceConnectionImpl::CfMContextServiceStarted(
DCHECK(file.IsValid());
CfmHotlineClient::Get()->BootstrapMojoConnection(
base::ScopedFD(file.TakePlatformFile()), std::move(callback_));
base::ScopedFD(file.TakePlatformFile()),
base::BindOnce(std::move(callback_), std::move(pending_receiver)));
}
void FakeServiceConnectionImpl::SetCallback(FakeBootstrapCallback callback) {
......
......@@ -7,7 +7,6 @@
#include <string>
#include "base/bind.h"
#include "chromeos/dbus/cfm/cfm_hotline_client.h"
#include "chromeos/services/cfm/public/cpp/service_connection.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
......@@ -22,7 +21,8 @@ namespace cfm {
class FakeServiceConnectionImpl : public ServiceConnection {
public:
using FakeBootstrapCallback =
CfmHotlineClient::BootstrapMojoConnectionCallback;
base::OnceCallback<void(mojo::PendingReceiver<mojom::CfmServiceContext>,
bool)>;
FakeServiceConnectionImpl();
FakeServiceConnectionImpl(const FakeServiceConnectionImpl&) = delete;
......@@ -30,14 +30,14 @@ class FakeServiceConnectionImpl : public ServiceConnection {
delete;
~FakeServiceConnectionImpl() override;
void BindServiceContext(
mojo::PendingReceiver<mojom::CfmServiceContext> receiver) override;
void BindServiceContext(mojo::PendingReceiver<mojom::CfmServiceContext>
pending_receiver) override;
void SetCallback(FakeBootstrapCallback callback);
private:
void CfMContextServiceStarted(
mojo::PendingReceiver<mojom::CfmServiceContext> receiver,
mojo::PendingReceiver<mojom::CfmServiceContext> pending_receiver,
bool is_available);
FakeBootstrapCallback callback_;
......
// Copyright 2019 The Chromium Authors. All rights reserved.
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
......@@ -56,12 +56,13 @@ class CfmServiceConnectionTest : public testing::Test {
TEST_F(CfmServiceConnectionTest, BindServiceContext) {
base::RunLoop run_loop;
base::MockCallback<FakeServiceConnectionImpl::FakeBootstrapCallback> callback;
ON_CALL(callback, Run(_)).WillByDefault(Invoke([&run_loop](bool success) {
run_loop.QuitClosure().Run();
}));
EXPECT_CALL(callback, Run(true)).Times(1);
SetCallback(callback.Get());
bool test_success = false;
SetCallback(base::BindLambdaForTesting(
[&](mojo::PendingReceiver<mojom::CfmServiceContext>, bool success) {
test_success = success;
run_loop.QuitClosure().Run();
}));
mojo::Remote<::chromeos::cfm::mojom::CfmServiceContext> remote;
ServiceConnection::GetInstance()->BindServiceContext(
......@@ -69,6 +70,7 @@ TEST_F(CfmServiceConnectionTest, BindServiceContext) {
run_loop.Run();
ASSERT_TRUE(test_success);
ASSERT_TRUE(remote.is_bound());
}
......
......@@ -5,6 +5,9 @@
import("//mojo/public/tools/bindings/mojom.gni")
mojom("mojom") {
sources = [ "cfm_service_manager.mojom" ]
sources = [
"cfm_browser.mojom",
"cfm_service_manager.mojom",
]
public_deps = [ "//mojo/public/mojom/base" ]
}
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Next MinVersion: 1
module chromeos.cfm.mojom;
// Interface defined by chromium specifically for the ChromeboxForMeetings
// platform to leverage required chromium services/APIS as approved by Security.
interface CfmBrowser {};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment