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

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

Issue 1769163002: Add a instance groups to Connect(), and introduce an Identity struct. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 9 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/identity.h ('k') | mojo/shell/public/cpp/lib/connection_impl.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 7f8f684d39f506b71424346a156735b9c38176f9..e2e582648b948358aba104aadb679c9aaf186d46 100644
--- a/mojo/shell/public/cpp/lib/application_test_base.cc
+++ b/mojo/shell/public/cpp/lib/application_test_base.cc
@@ -19,9 +19,8 @@ namespace test {
namespace {
// Share the application name with multiple application tests.
-String g_name;
+shell::mojom::IdentityPtr g_identity;
uint32_t g_id = shell::mojom::kInvalidInstanceID;
-String g_user_id = shell::mojom::kRootUserID;
// ShellClient request handle passed from the shell in MojoMain, stored in
// between SetUp()/TearDown() so we can (re-)intialize new ShellConnections.
@@ -45,20 +44,17 @@ class ShellGrabber : public shell::mojom::ShellClient {
private:
// shell::mojom::ShellClient implementation.
void Initialize(shell::mojom::ConnectorPtr connector,
- const String& name,
- const String& user_id,
+ shell::mojom::IdentityPtr identity,
uint32_t id) override {
- g_name = name;
+ g_identity = std::move(identity);
g_id = id;
- g_user_id = user_id;
g_shell_client_request = binding_.Unbind();
g_connector = std::move(connector);
}
void AcceptConnection(
- const String& requestor_name,
- const String& requestor_user_id,
- uint32_t requestor_id,
+ shell::mojom::IdentityPtr source,
+ uint32_t source_id,
shell::mojom::InterfaceProviderRequest local_interfaces,
shell::mojom::InterfaceProviderPtr remote_interfaces,
Array<String> allowed_interfaces,
@@ -118,12 +114,12 @@ TestHelper::TestHelper(ShellClient* client)
: shell_connection_(new ShellConnection(
client == nullptr ? &default_shell_client_ : client,
std::move(g_shell_client_request))),
- name_(g_name),
- userid_(g_user_id),
+ name_(g_identity->name),
+ userid_(g_identity->user_id),
instance_id_(g_id) {
// Fake ShellClient initialization.
shell::mojom::ShellClient* shell_client = shell_connection_.get();
- shell_client->Initialize(std::move(g_connector), g_name, g_user_id, g_id);
+ shell_client->Initialize(std::move(g_connector), std::move(g_identity), g_id);
}
TestHelper::~TestHelper() {
« no previous file with comments | « mojo/shell/public/cpp/identity.h ('k') | mojo/shell/public/cpp/lib/connection_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698