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

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
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 d1b2cfa66b65e7b1365a1707609e0e9e19b4badd..0d4092209c86036041b8c11be2825df48e12bf0b 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,
@@ -132,7 +137,7 @@ void ApplicationTestBase::SetUp() {
// Fake application initialization.
Application* application = application_impl_;
- application->Initialize(std::move(g_shell), g_url);
+ application->Initialize(std::move(g_shell), g_url, g_id);
}
void ApplicationTestBase::TearDown() {

Powered by Google App Engine
This is Rietveld 408576698