[links] Remove link passing tests

Links are being removed, and this is a step towards being able to
remove the associated FIDL API.

TESTED=N/A
MF-6 #comment Remove link passing tests

Change-Id: I11aa89798741f836461b5c41a7e59ea493a0530d
diff --git a/packages/tests/modular_integration_tests b/packages/tests/modular_integration_tests
index 29d1fff..3a7987f 100644
--- a/packages/tests/modular_integration_tests
+++ b/packages/tests/modular_integration_tests
@@ -4,9 +4,6 @@
         "peridot/packages/prod/integration_testing"
     ],
     "packages": [
-        "//peridot/tests/chain:chain_test_child_module",
-        "//peridot/tests/chain:chain_test_module",
-        "//peridot/tests/chain:chain_test_session_shell",
         "//peridot/tests/clipboard:clipboard_test_module",
         "//peridot/tests/common:common_active_module",
         "//peridot/tests/common:common_module_index",
@@ -27,9 +24,6 @@
         "//peridot/tests/link_data:link_data_test_module1",
         "//peridot/tests/link_data:link_data_test_module2",
         "//peridot/tests/link_data:link_data_test_session_shell",
-        "//peridot/tests/link_passing:link_passing_test_module1",
-        "//peridot/tests/link_passing:link_passing_test_module2",
-        "//peridot/tests/link_passing:link_passing_test_module3",
         "//peridot/tests:modular_tests",
         "//peridot/tests/module_context:module_context_test_session_shell",
         "//peridot/tests/module_context:module_context_test_module",
diff --git a/tests/link_passing/BUILD.gn b/tests/link_passing/BUILD.gn
deleted file mode 100644
index ca8ef08..0000000
--- a/tests/link_passing/BUILD.gn
+++ /dev/null
@@ -1,94 +0,0 @@
-# Copyright 2017 The Fuchsia Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//peridot/build/executable_package.gni")
-
-source_set("defs") {
-  testonly = true
-
-  sources = [
-    "defs.h",
-  ]
-}
-
-executable_package("link_passing_test_module1") {
-  deprecated_bare_package_url = "//build"
-
-  testonly = true
-
-  meta = [
-    {
-      path = "meta/link_passing_test_module1.cmx"
-      dest = "link_passing_test_module1.cmx"
-    },
-  ]
-
-  sources = [
-    "link_passing_test_module1.cc",
-  ]
-
-  deps = [
-    ":defs",
-    "//garnet/public/fidl/fuchsia.ui.viewsv1",
-    "//peridot/public/lib/integration_testing/cpp",
-    "//peridot/public/fidl/fuchsia.modular",
-    "//peridot/public/lib/app_driver/cpp:module_driver",
-    "//peridot/tests/common:defs",
-    "//zircon/public/lib/async-loop-cpp",
-  ]
-}
-
-executable_package("link_passing_test_module2") {
-  deprecated_bare_package_url = "//build"
-
-  testonly = true
-
-  meta = [
-    {
-      path = "meta/link_passing_test_module2.cmx"
-      dest = "link_passing_test_module2.cmx"
-    },
-  ]
-
-  sources = [
-    "link_passing_test_module2.cc",
-  ]
-
-  deps = [
-    ":defs",
-    "//garnet/public/fidl/fuchsia.ui.viewsv1",
-    "//peridot/public/lib/integration_testing/cpp",
-    "//peridot/public/fidl/fuchsia.modular",
-    "//peridot/public/lib/app_driver/cpp:module_driver",
-    "//peridot/tests/common:defs",
-    "//zircon/public/lib/async-loop-cpp",
-  ]
-}
-
-executable_package("link_passing_test_module3") {
-  deprecated_bare_package_url = "//build"
-
-  testonly = true
-
-  meta = [
-    {
-      path = "meta/link_passing_test_module3.cmx"
-      dest = "link_passing_test_module3.cmx"
-    },
-  ]
-
-  sources = [
-    "link_passing_test_module3.cc",
-  ]
-
-  deps = [
-    ":defs",
-    "//garnet/public/fidl/fuchsia.ui.viewsv1",
-    "//peridot/public/lib/integration_testing/cpp",
-    "//peridot/public/fidl/fuchsia.modular",
-    "//peridot/public/lib/app_driver/cpp:module_driver",
-    "//peridot/tests/common:defs",
-    "//zircon/public/lib/async-loop-cpp",
-  ]
-}
diff --git a/tests/link_passing/README.md b/tests/link_passing/README.md
deleted file mode 100644
index 8f26658..0000000
--- a/tests/link_passing/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# link_passing integration test
-
-This tests the passing of links through modules.
-
-1. Module1 starts Module2 and passes it a link.
-
-2. Module2 starts Module3 and passed it the link it got from Module1.
-
-3. Module3 sets a value in the link it got from Module1.
-
-4. The test succeeds if Module1 sees the value in its link.
-
-We do this for both a named link and a link with a null name (f.k.a. root link).
diff --git a/tests/link_passing/defs.h b/tests/link_passing/defs.h
deleted file mode 100644
index 0370b31..0000000
--- a/tests/link_passing/defs.h
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2018 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef PERIDOT_TESTS_LINK_PASSING_DEFS_H_
-#define PERIDOT_TESTS_LINK_PASSING_DEFS_H_
-
-namespace {
-
-// Package URLs of the test components used here.
-constexpr char kModule2Url[] =
-    "fuchsia-pkg://fuchsia.com/link_passing_test_module2#meta/link_passing_test_module2.cmx";
-constexpr char kModule2Action[] = "module2_action";
-
-constexpr char kModule3Url[] =
-    "fuchsia-pkg://fuchsia.com/link_passing_test_module3#meta/link_passing_test_module3.cmx";
-constexpr char kModule3Action[] = "module3_action";
-
-}  // namespace
-
-#endif  // PERIDOT_TESTS_LINK_PASSING_DEFS_H_
diff --git a/tests/link_passing/link_passing_test_module1.cc b/tests/link_passing/link_passing_test_module1.cc
deleted file mode 100644
index acfd21c..0000000
--- a/tests/link_passing/link_passing_test_module1.cc
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <fuchsia/modular/cpp/fidl.h>
-#include <fuchsia/ui/viewsv1/cpp/fidl.h>
-#include <lib/app_driver/cpp/module_driver.h>
-#include <lib/async-loop/cpp/loop.h>
-#include <lib/fsl/vmo/strings.h>
-
-#include "peridot/public/lib/integration_testing/cpp/reporting.h"
-#include "peridot/public/lib/integration_testing/cpp/testing.h"
-#include "peridot/tests/common/defs.h"
-#include "peridot/tests/link_passing/defs.h"
-
-using modular::testing::Signal;
-using modular::testing::TestPoint;
-
-namespace {
-
-// Cf. README.md for what this test does and how.
-class TestModule : fuchsia::modular::LinkWatcher {
- public:
-  TestModule(modular::ModuleHost* const module_host,
-             fidl::InterfaceRequest<
-                 fuchsia::ui::app::ViewProvider> /*view_provider_request*/)
-      : module_host_(module_host),
-        link1_watcher_binding_(this),
-        link2_watcher_binding_(this) {
-    modular::testing::Init(module_host->startup_context(), __FILE__);
-    modular::testing::GetStore()->Put("module1_init", "", [] {});
-
-    Start();
-  }
-
-  TestModule(modular::ModuleHost* const module_host,
-             fidl::InterfaceRequest<
-                 fuchsia::ui::viewsv1::ViewProvider> /*view_provider_request*/)
-      : TestModule(
-            module_host,
-            fidl::InterfaceRequest<fuchsia::ui::app::ViewProvider>(nullptr)) {}
-
-  void Start() {
-    module_host_->module_context()->GetLink("link", link1_.NewRequest());
-    link1_->WatchAll(link1_watcher_binding_.NewBinding());
-
-    module_host_->module_context()->GetLink(nullptr, link2_.NewRequest());
-    link2_->WatchAll(link2_watcher_binding_.NewBinding());
-
-    fuchsia::modular::IntentParameter param1;
-    param1.name = "link1";
-    param1.data.set_link_name("link");
-
-    fuchsia::modular::IntentParameter param2;
-    param2.name = "link2";
-    param2.data.set_link_name(nullptr);
-
-    fuchsia::modular::Intent intent;
-    intent.handler = kModule2Url;
-    intent.action = kModule2Action;
-    intent.parameters.push_back(std::move(param1));
-    intent.parameters.push_back(std::move(param2));
-
-    module_host_->module_context()->AddModuleToStory(
-        "two", std::move(intent), module_controller_.NewRequest(),
-        nullptr /* surface_relation */,
-        [](fuchsia::modular::StartModuleStatus) {});
-  }
-
-  // Called from ModuleDriver.
-  void Terminate(const std::function<void()>& done) {
-    modular::testing::GetStore()->Put("module1_stop", "", [] {});
-    modular::testing::Done(done);
-  }
-
- private:
-  TestPoint link1_check_{"Link1"};
-  TestPoint link2_check_{"Link2"};
-
-  bool link1_checked_{};
-  bool link2_checked_{};
-
-  // |fuchsia::modular::LinkWatcher|
-  void Notify(fuchsia::mem::Buffer content) override {
-    std::string json;
-    FXL_CHECK(fsl::StringFromVmo(content, &json));
-    // This watches both link1 and link2. We distinguish the two by the value
-    // received.
-    FXL_LOG(INFO) << "module1 link: " << json;
-
-    // TODO(mesch): Although allowed by fuchsia::modular::Link in principle,
-    // it's not quite clear why we receive this notification twice.
-    if (json == "1" && !link1_checked_) {
-      link1_check_.Pass();
-      link1_checked_ = true;
-    }
-
-    if (json == "2" && !link2_checked_) {
-      link2_check_.Pass();
-      link2_checked_ = true;
-    }
-
-    if (link1_checked_ && link2_checked_) {
-      Signal(modular::testing::kTestShutdown);
-    }
-  }
-
-  modular::ModuleHost* const module_host_;
-  fuchsia::modular::LinkPtr link1_;
-  fidl::Binding<fuchsia::modular::LinkWatcher> link1_watcher_binding_;
-  fuchsia::modular::LinkPtr link2_;
-  fidl::Binding<fuchsia::modular::LinkWatcher> link2_watcher_binding_;
-  fuchsia::modular::ModuleControllerPtr module_controller_;
-
-  FXL_DISALLOW_COPY_AND_ASSIGN(TestModule);
-};
-
-}  // namespace
-
-int main(int /*argc*/, const char** /*argv*/) {
-  async::Loop loop(&kAsyncLoopConfigAttachToThread);
-  auto context = component::StartupContext::CreateFromStartupInfo();
-  modular::ModuleDriver<TestModule> driver(context.get(),
-                                           [&loop] { loop.Quit(); });
-  loop.Run();
-  return 0;
-}
diff --git a/tests/link_passing/link_passing_test_module2.cc b/tests/link_passing/link_passing_test_module2.cc
deleted file mode 100644
index a029664..0000000
--- a/tests/link_passing/link_passing_test_module2.cc
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <fuchsia/modular/cpp/fidl.h>
-#include <fuchsia/ui/viewsv1/cpp/fidl.h>
-#include <lib/app_driver/cpp/module_driver.h>
-#include <lib/async-loop/cpp/loop.h>
-#include <lib/fsl/vmo/strings.h>
-
-#include "peridot/public/lib/integration_testing/cpp/reporting.h"
-#include "peridot/public/lib/integration_testing/cpp/testing.h"
-#include "peridot/tests/common/defs.h"
-#include "peridot/tests/link_passing/defs.h"
-
-using modular::testing::TestPoint;
-
-namespace {
-
-// Cf. README.md for what this test does and how.
-class TestModule : fuchsia::modular::LinkWatcher {
- public:
-  TestModule(modular::ModuleHost* const module_host,
-             fidl::InterfaceRequest<
-                 fuchsia::ui::app::ViewProvider> /*view_provider_request*/)
-      : module_host_(module_host),
-        link1_watcher_binding_(this),
-        link2_watcher_binding_(this) {
-    modular::testing::Init(module_host->startup_context(), __FILE__);
-    modular::testing::GetStore()->Put("module2_init", "", [] {});
-
-    Start();
-  }
-
-  TestModule(modular::ModuleHost* const module_host,
-             fidl::InterfaceRequest<
-                 fuchsia::ui::viewsv1::ViewProvider> /*view_provider_request*/)
-      : TestModule(
-            module_host,
-            fidl::InterfaceRequest<fuchsia::ui::app::ViewProvider>(nullptr)) {}
-
-  void Start() {
-    module_host_->module_context()->GetLink("link1", link1_.NewRequest());
-    link1_->WatchAll(link1_watcher_binding_.NewBinding());
-
-    module_host_->module_context()->GetLink("link2", link2_.NewRequest());
-    link2_->WatchAll(link2_watcher_binding_.NewBinding());
-
-    fuchsia::modular::IntentParameter param1;
-    param1.name = "link1";
-    param1.data.set_link_name("link1");
-
-    fuchsia::modular::IntentParameter param2;
-    param2.name = "link2";
-    param2.data.set_link_name("link2");
-
-    fuchsia::modular::Intent intent;
-    intent.handler = kModule3Url;
-    intent.action = kModule3Action;
-    intent.parameters.push_back(std::move(param1));
-    intent.parameters.push_back(std::move(param2));
-
-    module_host_->module_context()->AddModuleToStory(
-        "three", std::move(intent), module_controller_.NewRequest(),
-        nullptr /* surface_relation */,
-        [](fuchsia::modular::StartModuleStatus) {});
-  }
-
-  // Called from ModuleDriver.
-  void Terminate(const std::function<void()>& done) {
-    modular::testing::GetStore()->Put("module2_stop", "", [] {});
-    modular::testing::Done(done);
-  }
-
- private:
-  // |fuchsia::modular::LinkWatcher|
-  void Notify(fuchsia::mem::Buffer json) override {
-    std::string json_string;
-    FXL_CHECK(fsl::StringFromVmo(json, &json_string));
-    FXL_LOG(INFO) << "module2 link: " << json_string;
-  }
-
-  modular::ModuleHost* const module_host_;
-  fuchsia::modular::LinkPtr link1_;
-  fidl::Binding<fuchsia::modular::LinkWatcher> link1_watcher_binding_;
-  fuchsia::modular::LinkPtr link2_;
-  fidl::Binding<fuchsia::modular::LinkWatcher> link2_watcher_binding_;
-  fuchsia::modular::ModuleControllerPtr module_controller_;
-
-  FXL_DISALLOW_COPY_AND_ASSIGN(TestModule);
-};
-
-}  // namespace
-
-int main(int /*argc*/, const char** /*argv*/) {
-  async::Loop loop(&kAsyncLoopConfigAttachToThread);
-  auto context = component::StartupContext::CreateFromStartupInfo();
-  modular::ModuleDriver<TestModule> driver(context.get(),
-                                           [&loop] { loop.Quit(); });
-  loop.Run();
-  return 0;
-}
diff --git a/tests/link_passing/link_passing_test_module3.cc b/tests/link_passing/link_passing_test_module3.cc
deleted file mode 100644
index 7787fc5..0000000
--- a/tests/link_passing/link_passing_test_module3.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2017 The Fuchsia Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <fuchsia/modular/cpp/fidl.h>
-#include <fuchsia/ui/viewsv1/cpp/fidl.h>
-#include <lib/app_driver/cpp/module_driver.h>
-#include <lib/async-loop/cpp/loop.h>
-#include <lib/fsl/vmo/strings.h>
-
-#include "peridot/public/lib/integration_testing/cpp/reporting.h"
-#include "peridot/public/lib/integration_testing/cpp/testing.h"
-#include "peridot/tests/common/defs.h"
-#include "peridot/tests/link_passing/defs.h"
-
-using modular::testing::TestPoint;
-
-namespace {
-
-// Cf. README.md for what this test does and how.
-class TestModule : fuchsia::modular::LinkWatcher {
- public:
-  TestModule(modular::ModuleHost* const module_host,
-             fidl::InterfaceRequest<
-                 fuchsia::ui::app::ViewProvider> /*view_provider_request*/)
-      : module_host_(module_host),
-        link1_watcher_binding_(this),
-        link2_watcher_binding_(this) {
-    modular::testing::Init(module_host->startup_context(), __FILE__);
-    modular::testing::GetStore()->Put("module3_init", "", [] {});
-
-    Start();
-  }
-
-  TestModule(modular::ModuleHost* const module_host,
-             fidl::InterfaceRequest<
-                 fuchsia::ui::viewsv1::ViewProvider> /*view_provider_request*/)
-      : TestModule(
-            module_host,
-            fidl::InterfaceRequest<fuchsia::ui::app::ViewProvider>(nullptr)) {}
-
-  void Start() {
-    module_host_->module_context()->GetLink("link1", link1_.NewRequest());
-    link1_->WatchAll(link1_watcher_binding_.NewBinding());
-
-    module_host_->module_context()->GetLink("link2", link2_.NewRequest());
-    link2_->WatchAll(link2_watcher_binding_.NewBinding());
-
-    fsl::SizedVmo vmo1;
-    FXL_CHECK(fsl::VmoFromString("1", &vmo1));
-    fsl::SizedVmo vmo2;
-    FXL_CHECK(fsl::VmoFromString("2", &vmo2));
-    link1_->Set(nullptr, std::move(vmo1).ToTransport());
-    link2_->Set(nullptr, std::move(vmo2).ToTransport());
-  }
-
-  // Called from ModuleDriver.
-  void Terminate(const std::function<void()>& done) {
-    modular::testing::GetStore()->Put("module3_stop", "", [] {});
-    modular::testing::Done(done);
-  }
-
- private:
-  // |fuchsia::modular::LinkWatcher|
-  void Notify(fuchsia::mem::Buffer content) override {
-    std::string json;
-    FXL_CHECK(fsl::StringFromVmo(content, &json));
-    FXL_LOG(INFO) << "module3 link: " << json;
-  }
-
-  modular::ModuleHost* const module_host_;
-  fuchsia::modular::LinkPtr link1_;
-  fidl::Binding<fuchsia::modular::LinkWatcher> link1_watcher_binding_;
-  fuchsia::modular::LinkPtr link2_;
-  fidl::Binding<fuchsia::modular::LinkWatcher> link2_watcher_binding_;
-
-  FXL_DISALLOW_COPY_AND_ASSIGN(TestModule);
-};
-
-}  // namespace
-
-int main(int /*argc*/, const char** /*argv*/) {
-  async::Loop loop(&kAsyncLoopConfigAttachToThread);
-  auto context = component::StartupContext::CreateFromStartupInfo();
-  modular::ModuleDriver<TestModule> driver(context.get(),
-                                           [&loop] { loop.Quit(); });
-  loop.Run();
-  return 0;
-}
diff --git a/tests/link_passing/meta/link_passing_test_module1.cmx b/tests/link_passing/meta/link_passing_test_module1.cmx
deleted file mode 100644
index 16f817c..0000000
--- a/tests/link_passing/meta/link_passing_test_module1.cmx
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-    "program": {
-        "binary": "bin/app"
-    },
-    "sandbox": {
-        "services": [
-            "fuchsia.cobalt.LoggerFactory",
-            "fuchsia.modular.ModuleContext",
-            "fuchsia.modular.PuppetMaster",
-            "fuchsia.modular.SessionShellContext",
-            "fuchsia.net.LegacySocketProvider",
-            "fuchsia.sys.Environment",
-            "fuchsia.sys.Launcher",
-            "fuchsia.sys.Loader",
-            "fuchsia.testing.runner.TestRunner",
-            "fuchsia.testing.runner.TestRunnerStore",
-            "fuchsia.tracelink.Registry",
-            "fuchsia.ui.policy.Presenter",
-            "fuchsia.ui.scenic.Scenic",
-            "fuchsia.ui.viewsv1.ViewManager",
-            "fuchsia.ui.viewsv1.ViewSnapshot"
-        ]
-    }
-}
\ No newline at end of file
diff --git a/tests/link_passing/meta/link_passing_test_module2.cmx b/tests/link_passing/meta/link_passing_test_module2.cmx
deleted file mode 100644
index 16f817c..0000000
--- a/tests/link_passing/meta/link_passing_test_module2.cmx
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-    "program": {
-        "binary": "bin/app"
-    },
-    "sandbox": {
-        "services": [
-            "fuchsia.cobalt.LoggerFactory",
-            "fuchsia.modular.ModuleContext",
-            "fuchsia.modular.PuppetMaster",
-            "fuchsia.modular.SessionShellContext",
-            "fuchsia.net.LegacySocketProvider",
-            "fuchsia.sys.Environment",
-            "fuchsia.sys.Launcher",
-            "fuchsia.sys.Loader",
-            "fuchsia.testing.runner.TestRunner",
-            "fuchsia.testing.runner.TestRunnerStore",
-            "fuchsia.tracelink.Registry",
-            "fuchsia.ui.policy.Presenter",
-            "fuchsia.ui.scenic.Scenic",
-            "fuchsia.ui.viewsv1.ViewManager",
-            "fuchsia.ui.viewsv1.ViewSnapshot"
-        ]
-    }
-}
\ No newline at end of file
diff --git a/tests/link_passing/meta/link_passing_test_module3.cmx b/tests/link_passing/meta/link_passing_test_module3.cmx
deleted file mode 100644
index 16f817c..0000000
--- a/tests/link_passing/meta/link_passing_test_module3.cmx
+++ /dev/null
@@ -1,24 +0,0 @@
-{
-    "program": {
-        "binary": "bin/app"
-    },
-    "sandbox": {
-        "services": [
-            "fuchsia.cobalt.LoggerFactory",
-            "fuchsia.modular.ModuleContext",
-            "fuchsia.modular.PuppetMaster",
-            "fuchsia.modular.SessionShellContext",
-            "fuchsia.net.LegacySocketProvider",
-            "fuchsia.sys.Environment",
-            "fuchsia.sys.Launcher",
-            "fuchsia.sys.Loader",
-            "fuchsia.testing.runner.TestRunner",
-            "fuchsia.testing.runner.TestRunnerStore",
-            "fuchsia.tracelink.Registry",
-            "fuchsia.ui.policy.Presenter",
-            "fuchsia.ui.scenic.Scenic",
-            "fuchsia.ui.viewsv1.ViewManager",
-            "fuchsia.ui.viewsv1.ViewSnapshot"
-        ]
-    }
-}
\ No newline at end of file
diff --git a/tests/modular_tests.json b/tests/modular_tests.json
index a7c6c07..b682c0e 100644
--- a/tests/modular_tests.json
+++ b/tests/modular_tests.json
@@ -92,19 +92,6 @@
       ]
     },
     {
-      "name": "link_passing",
-      "exec": [
-        "fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx",
-        "--test",
-        "--account_provider=fuchsia-pkg://fuchsia.com/dev_token_manager#meta/dev_token_manager.cmx",
-        "--base_shell=fuchsia-pkg://fuchsia.com/dev_base_shell#meta/dev_base_shell.cmx",
-        "--session_shell=fuchsia-pkg://fuchsia.com/dev_session_shell#meta/dev_session_shell.cmx",
-        "--story_shell=fuchsia-pkg://fuchsia.com/dev_story_shell#meta/dev_story_shell.cmx",
-        "--session_shell_args=--root_module=fuchsia-pkg://fuchsia.com/link_passing_test_module1#meta/link_passing_test_module1.cmx",
-        "--sessionmgr_args=--use_memfs_for_ledger"
-      ]
-    },
-    {
       "name": "parent_child",
       "exec": [
         "fuchsia-pkg://fuchsia.com/basemgr#meta/basemgr.cmx",