Commit 21397d6e authored by ben's avatar ben Committed by Commit bot

Make views_mus_unittests use a static manifest

Extracted from https://codereview.chromium.org/1910043002/ to help identify an issue.

TBR=sky@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1918343002

Cr-Commit-Position: refs/heads/master@{#389828}
parent 9f0095b4
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/ui.gni") import("//build/config/ui.gni")
import("//mojo/public/mojo_application.gni") import("//mojo/public/mojo_application.gni")
import("//mojo/public/mojo_application_manifest.gni")
import("//testing/test.gni") import("//testing/test.gni")
import("//tools/grit/repack.gni") import("//tools/grit/repack.gni")
...@@ -195,6 +196,7 @@ test("views_mus_unittests") { ...@@ -195,6 +196,7 @@ test("views_mus_unittests") {
] ]
data_deps = [ data_deps = [
":unittests_manifest",
"//mash/wm", "//mash/wm",
] ]
...@@ -230,6 +232,12 @@ test("views_mus_unittests") { ...@@ -230,6 +232,12 @@ test("views_mus_unittests") {
} }
} }
mojo_application_manifest("unittests_manifest") {
type = "exe"
application_name = "views_mus_unittests"
source = "unittests_manifest.json"
}
group("for_component") { group("for_component") {
public_deps = [ public_deps = [
":mus", ":mus",
......
...@@ -20,7 +20,7 @@ using shell::BackgroundShell; ...@@ -20,7 +20,7 @@ using shell::BackgroundShell;
namespace views { namespace views {
namespace { namespace {
const char kTestName[] = "mojo:test-app"; const char kTestName[] = "exe:views_mus_unittests";
class DefaultShellClient : public shell::ShellClient { class DefaultShellClient : public shell::ShellClient {
public: public:
...@@ -31,20 +31,11 @@ class DefaultShellClient : public shell::ShellClient { ...@@ -31,20 +31,11 @@ class DefaultShellClient : public shell::ShellClient {
DISALLOW_COPY_AND_ASSIGN(DefaultShellClient); DISALLOW_COPY_AND_ASSIGN(DefaultShellClient);
}; };
std::unique_ptr<shell::TestCatalogStore> BuildTestCatalogStore() {
std::unique_ptr<base::ListValue> apps(new base::ListValue);
apps->Append(shell::BuildPermissiveSerializedAppInfo(kTestName, "test"));
return base::WrapUnique(new shell::TestCatalogStore(std::move(apps)));
}
class PlatformTestHelperMus : public PlatformTestHelper { class PlatformTestHelperMus : public PlatformTestHelper {
public: public:
PlatformTestHelperMus() { PlatformTestHelperMus() {
background_shell_.reset(new BackgroundShell); background_shell_.reset(new BackgroundShell);
std::unique_ptr<BackgroundShell::InitParams> init_params( background_shell_->Init(nullptr);
new BackgroundShell::InitParams);
init_params->catalog_store = BuildTestCatalogStore();
background_shell_->Init(std::move(init_params));
shell_client_.reset(new DefaultShellClient); shell_client_.reset(new DefaultShellClient);
shell_connection_.reset(new shell::ShellConnection( shell_connection_.reset(new shell::ShellConnection(
shell_client_.get(), shell_client_.get(),
......
{
"manifest_version": 1,
"name": "mojo:views_mus_unittests",
"display_name": "Views Mus Unittests",
"capabilities": {
"required": {
"mojo:desktop_wm": { "interfaces": [ "*" ] },
"mojo:mus": { "interfaces": [ "*" ] }
}
}
}
\ No newline at end of file
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