src/modular/lib/modular_config/modular_config_unittest.cc
// Test that ModularConfigReader finds and reads the startup.config file given a
// root directory that contains config data.
Test that ModularConfigReader finds and reads the startup.config file given a
root directory that contains config data.
Test that ModularConfigReader finds and reads the startup . config file given a root directory that contains config data .
TEST_F(ModularConfigReaderTest, OverrideConfigDir) {
  constexpr char kSessionShellForTest[] =
      "fuchsia-pkg://example.com/ModularConfigReaderTest#meta/"
      "ModularConfigReaderTest.cmx";
  std::string config_contents = fxl::Substitute(
      R"({
        "basemgr": {
          "session_shells": [
            {
              "url": "$0"
            }
          ]
        }
      })",
      kSessionShellForTest);
  modular::PseudoDirServer server(modular::MakeFilePathWithContents(
      files::JoinPath(modular_config::kOverriddenConfigDir, modular_config::kStartupConfigFilePath),
      config_contents));
  modular::ModularConfigReader reader(server.OpenAt("."));
  auto config = reader.GetBasemgrConfig();
  EXPECT_EQ(kSessionShellForTest, config.session_shell_map().at(0).config().app_config().url());
}
TEST_F ( ModularConfigReaderTest , OverrideConfigDir ) { constexpr char kSessionShellForTest [ ] = " " " " ; std :: string config_contents = fxl :: Substitute ( R" ( {
        "basemgr": {
          "session_shells": [
            {
              "url": "$0"
            }
          ]
        }
      } ) " , kSessionShellForTest ) ; modular :: PseudoDirServer server ( modular :: MakeFilePathWithContents ( files :: JoinPath ( modular_config :: kOverriddenConfigDir , modular_config :: kStartupConfigFilePath ) , config_contents ) ) ; modular :: ModularConfigReader reader ( server . OpenAt ( " " ) ) ; auto config = reader . GetBasemgrConfig ( ) ; EXPECT_EQ ( kSessionShellForTest , config . session_shell_map ( ) . at ( 0 ) . config ( ) . app_config ( ) . url ( ) ) ; }
Test that ModularConfigReader finds and reads the startup.config file given a
root directory that contains config data.
Test that ModularConfigReader finds and reads the startup . config file given a root directory that contains config data .
// Verify that ModularConfigReader parsed the config value we gave it.