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

Unified Diff: mojo/shell/public/cpp/lib/application_test_base.cc

Issue 1578473002: Pass application ids via AcceptConnection & ConnectToApplication callback. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 11 months 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
« no previous file with comments | « mojo/shell/public/cpp/lib/application_impl.cc ('k') | mojo/shell/public/cpp/lib/service_registry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/lib/application_test_base.cc
diff --git a/mojo/shell/public/cpp/lib/application_test_base.cc b/mojo/shell/public/cpp/lib/application_test_base.cc
index 8b4747e4710b7cca1bd4bea6ef6bc8b09e003976..c9d08c18b7af6c050637659107e1141aced386bf 100644
--- a/mojo/shell/public/cpp/lib/application_test_base.cc
+++ b/mojo/shell/public/cpp/lib/application_test_base.cc
@@ -19,6 +19,7 @@ namespace test {
namespace {
// Share the application URL with multiple application tests.
String g_url;
+uint32_t g_id = Shell::kInvalidApplicationID;
// Application request handle passed from the shell in MojoMain, stored in
// between SetUp()/TearDown() so we can (re-)intialize new ApplicationImpls.
@@ -41,13 +42,17 @@ class ShellGrabber : public Application {
private:
// Application implementation.
- void Initialize(ShellPtr shell, const mojo::String& url) override {
+ void Initialize(ShellPtr shell,
+ const mojo::String& url,
+ uint32_t id) override {
g_url = url;
+ g_id = id;
g_application_request = binding_.Unbind();
g_shell = std::move(shell);
}
void AcceptConnection(const String& requestor_url,
+ uint32_t requestor_id,
InterfaceRequest<ServiceProvider> services,
ServiceProviderPtr exposed_services,
Array<String> allowed_interfaces,
@@ -113,7 +118,7 @@ TestHelper::TestHelper(ApplicationDelegate* delegate)
std::move(g_application_request))) {
// Fake application initialization.
Application* application = application_impl_.get();
- application->Initialize(std::move(g_shell), g_url);
+ application->Initialize(std::move(g_shell), g_url, g_id);
}
TestHelper::~TestHelper() {
« no previous file with comments | « mojo/shell/public/cpp/lib/application_impl.cc ('k') | mojo/shell/public/cpp/lib/service_registry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698