Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1920)

Unified Diff: mojo/shell/application_manager_apptest_driver.cc

Issue 1465793005: Pass CapabilityFilter via CreateInstanceForHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: mojo/shell/application_manager_apptest_driver.cc
diff --git a/mojo/shell/application_manager_apptest_driver.cc b/mojo/shell/application_manager_apptest_driver.cc
index 290fc32516f8eaad3e6ca489c506fdea3dce674d..e5bf3dade5db2955ef777a7eaad1aaa95d197a00 100644
--- a/mojo/shell/application_manager_apptest_driver.cc
+++ b/mojo/shell/application_manager_apptest_driver.cc
@@ -17,11 +17,11 @@
#include "mojo/application/public/cpp/application_delegate.h"
#include "mojo/application/public/cpp/application_impl.h"
#include "mojo/application/public/cpp/interface_factory.h"
+#include "mojo/application/public/interfaces/application_manager.mojom.h"
#include "mojo/common/weak_binding_set.h"
#include "mojo/converters/network/network_type_converters.h"
#include "mojo/runner/child/test_native_main.h"
#include "mojo/runner/init.h"
-#include "mojo/shell/application_manager.mojom.h"
#include "mojo/shell/application_manager_apptests.mojom.h"
#include "third_party/mojo/src/mojo/edk/embedder/embedder.h"
#include "third_party/mojo/src/mojo/edk/embedder/platform_channel_pair.h"
@@ -79,10 +79,16 @@ class TargetApplicationDelegate : public mojo::ApplicationDelegate,
weak_factory_.GetWeakPtr()),
base::ThreadTaskRunnerHandle::Get()));
+ mojo::CapabilityFilterPtr filter(mojo::CapabilityFilter::New());
+ mojo::Array<mojo::String> test_interfaces;
+ test_interfaces.push_back(
+ mojo::shell::test::mojom::CreateInstanceForHandleTest::Name_);
+ filter->filter.insert("mojo:mojo_shell_apptests", test_interfaces.Pass());
application_manager->CreateInstanceForHandle(
mojo::ScopedHandle(mojo::Handle(handle.release().value())),
"exe:application_manager_apptest_target",
- "0");
+ filter.Pass());
+
// Put the other end on the command line used to launch the target.
platform_channel_pair.PrepareToPassClientHandleToChildProcess(
&child_command_line, &handle_passing_info);

Powered by Google App Engine
This is Rietveld 408576698