sdk/lib/modular/testing/cpp/fake_component_test.cc
// Test that the options returned from FakeComponent::BuildInterceptOptions() intercepts and handles
// the component launch.
Test that the options returned from FakeComponent::BuildInterceptOptions() intercepts and handles
the component launch.
Test that the options returned from FakeComponent :: BuildInterceptOptions () intercepts and handles the component launch .
TEST_F(FakeComponentTest, BuildInterceptOptions) {
  modular_testing::FakeComponent fake_agent(
      {.url = modular_testing::TestHarnessBuilder::GenerateFakeUrl()});
  fuchsia::modular::testing::TestHarnessSpec spec;
  spec.mutable_sessionmgr_config()->mutable_session_agents()->push_back(fake_agent.url());
  modular_testing::TestHarnessBuilder builder(std::move(spec));
  builder.InterceptComponent(fake_agent.BuildInterceptOptions());
  builder.BuildAndRun(test_harness());
  RunLoopUntil([&] { return fake_agent.is_running(); });
}
TEST_F ( FakeComponentTest , BuildInterceptOptions ) { modular_testing :: FakeComponent fake_agent ( { . url = modular_testing :: TestHarnessBuilder :: GenerateFakeUrl ( ) } ) ; fuchsia :: modular :: testing :: TestHarnessSpec spec ; spec . mutable_sessionmgr_config ( ) -> mutable_session_agents ( ) -> push_back ( fake_agent . url ( ) ) ; modular_testing :: TestHarnessBuilder builder ( std :: move ( spec ) ) ; builder . InterceptComponent ( fake_agent . BuildInterceptOptions ( ) ) ; builder . BuildAndRun ( test_harness ( ) ) ; RunLoopUntil ( [ & ] { return fake_agent . is_running ( ) ; } ) ; }
Test that the options returned from FakeComponent::BuildInterceptOptions() intercepts and handles
the component launch.
Test that the options returned from FakeComponent :: BuildInterceptOptions () intercepts and handles the component launch .