Skip to content
Snippets Groups Projects
Commit 8c9e4f6f authored by Ankur Mittal's avatar Ankur Mittal Committed by CQ bot account: commit-bot@chromium.org
Browse files

[appmgr][test] Switch to new testing utility.

DX-387 #comment

TEST=CQ

Change-Id: I0fe34811ab118935ee4d0b3caeb87c9485fd5ad2
parent ec205fa9
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@
#include <lib/fdio/fd.h>
#include <lib/fdio/fdio.h>
#include <lib/gtest/real_loop_fixture.h>
#include <lib/sys/cpp/testing/service_directory_for_test.h>
#include <lib/sys/cpp/testing/service_directory_provider.h>
#include <lib/vfs/cpp/pseudo_dir.h>
#include <lib/vfs/cpp/service.h>
#include <lib/zx/channel.h>
......@@ -78,8 +78,6 @@ class NamespaceHostDirectoryTest : public NamespaceTest {
class NamespaceProviderTest : public NamespaceTest {
protected:
NamespaceProviderTest()
: provider_(sys::testing::ServiceDirectoryForTest::Create()) {}
fxl::RefPtr<Namespace> MakeNamespace(ServiceListPtr additional_services) {
return fxl::MakeRefCounted<Namespace>(
nullptr, nullptr, std::move(additional_services), nullptr);
......@@ -90,11 +88,11 @@ class NamespaceProviderTest : public NamespaceTest {
[this, name](fidl::InterfaceRequest<fuchsia::io::Node> request) {
++connection_ctr_[name];
};
provider_->AddService(std::move(cb), name);
provider_.AddService(std::move(cb), name);
return ZX_OK;
}
std::shared_ptr<sys::testing::ServiceDirectoryForTest> provider_;
sys::testing::ServiceDirectoryProvider provider_;
std::map<std::string, int> connection_ctr_;
};
......@@ -169,7 +167,8 @@ TEST_F(NamespaceProviderTest, AdditionalServices) {
EXPECT_EQ(ZX_OK, AddService(kService1));
EXPECT_EQ(ZX_OK, AddService(kService2));
service_list->host_directory = provider_->CloneChannel().TakeChannel();
service_list->host_directory =
provider_.service_directory()->CloneChannel().TakeChannel();
auto ns = MakeNamespace(std::move(service_list));
zx::channel svc_dir = ns->OpenServicesAsDirectory();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment