From 6e47685c9153b1d26ce5d2f955ebd6aea67e09d3 Mon Sep 17 00:00:00 2001 From: sky Date: Mon, 21 Mar 2016 09:38:30 -0700 Subject: Adds option to run browser tests in mash At a high level this is what the code does: . The test launcher creates MojoTestConnector. . MojoTestConnector creates a BackgroundShell (initially I wanted to run the shell on the same thread, but that is problematic because I need to run a nested message loop at times, which the IO thread doesn't support (the test launcher uses an io thread)). . A connection is established to mojo:mash_shell. . MojoTestConnector sets up the state for each test. The connect is not done with Mojo's child process connection. The base test launching code handles the actual process launching. Other random notes: . --single_process is a slightly different flow. . The test never finishes. This is because apps that are started don't all exit when the shell exits. I'm going to look at that next. R=ben@chromium.org, jam@chromium.org BUG=581733 Review URL: https://codereview.chromium.org/1806353003 Cr-Commit-Position: refs/heads/master@{#382305} --- mojo/shell/background/tests/test_catalog_store.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'mojo/shell/background/tests') diff --git a/mojo/shell/background/tests/test_catalog_store.cc b/mojo/shell/background/tests/test_catalog_store.cc index 32a1aa4..41daf82 100644 --- a/mojo/shell/background/tests/test_catalog_store.cc +++ b/mojo/shell/background/tests/test_catalog_store.cc @@ -28,14 +28,20 @@ scoped_ptr BuildPermissiveSerializedAppInfo( scoped_ptr app(new base::DictionaryValue); app->SetString(Store::kNameKey, name); app->SetString(Store::kDisplayNameKey, display_name); + app->SetInteger(Store::kManifestVersionKey, 1); scoped_ptr capabilities(new base::DictionaryValue); - scoped_ptr interfaces(new base::ListValue); - interfaces->AppendString("*"); - capabilities->Set("*", std::move(interfaces)); - + scoped_ptr required_capabilities( + new base::DictionaryValue); + scoped_ptr interfaces_dictionary( + new base::DictionaryValue); + scoped_ptr interfaces_list(new base::ListValue); + interfaces_list->AppendString("*"); + interfaces_dictionary->Set("interfaces", std::move(interfaces_list)); + required_capabilities->Set("*", std::move(interfaces_dictionary)); + capabilities->Set(Store::kCapabilities_RequiredKey, + std::move(required_capabilities)); app->Set(Store::kCapabilitiesKey, std::move(capabilities)); - return app; } -- cgit v1.1