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

Unified Diff: mojo/shell/tests/capability_filter_test.cc

Issue 1725353003: Eliminate mojo::Shell client lib class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@15connector
Patch Set: . Created 4 years, 10 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/tests/capability_filter_test.h ('k') | mojo/shell/tests/package_apptest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/tests/capability_filter_test.cc
diff --git a/mojo/shell/tests/capability_filter_test.cc b/mojo/shell/tests/capability_filter_test.cc
index 3fac67c5645c70b87f3ecc4042f02ab4865fc106..1c3a1fac5542098e3de4733ceb52efe39a50f0e7 100644
--- a/mojo/shell/tests/capability_filter_test.cc
+++ b/mojo/shell/tests/capability_filter_test.cc
@@ -14,6 +14,7 @@
#include "mojo/services/package_manager/package_manager.h"
#include "mojo/shell/application_loader.h"
#include "mojo/shell/public/cpp/connection.h"
+#include "mojo/shell/public/cpp/connector.h"
#include "mojo/shell/public/cpp/interface_factory.h"
#include "mojo/shell/public/cpp/shell_connection.h"
@@ -111,17 +112,16 @@ class ServiceApplication : public ShellClient,
public Safe,
public Unsafe {
public:
- ServiceApplication() : shell_(nullptr) {}
+ ServiceApplication() {}
~ServiceApplication() override {}
private:
// Overridden from ShellClient:
- void Initialize(Shell* shell, const std::string& url, uint32_t id,
+ void Initialize(Connector* connector, const std::string& url, uint32_t id,
uint32_t user_id) override {
- shell_ = shell;
// ServiceApplications have no capability filter and can thus connect
// directly to the validator application.
- shell_->ConnectToInterface("test:validator", &validator_);
+ connector->ConnectToInterface("test:validator", &validator_);
}
bool AcceptConnection(Connection* connection) override {
AddInterface<Safe>(connection);
@@ -149,7 +149,6 @@ class ServiceApplication : public ShellClient,
!connection->AddInterface<Interface>(this));
}
- Shell* shell_;
ValidatorPtr validator_;
BindingSet<Safe> safe_bindings_;
BindingSet<Unsafe> unsafe_bindings_;
@@ -160,24 +159,24 @@ class ServiceApplication : public ShellClient,
////////////////////////////////////////////////////////////////////////////////
// TestApplication:
-TestApplication::TestApplication() : shell_(nullptr) {}
+TestApplication::TestApplication() : connector_(nullptr) {}
TestApplication::~TestApplication() {}
-void TestApplication::Initialize(Shell* shell, const std::string& url,
+void TestApplication::Initialize(Connector* connector, const std::string& url,
uint32_t id, uint32_t user_id) {
- shell_ = shell;
+ connector_ = connector;
url_ = url;
}
bool TestApplication::AcceptConnection(Connection* connection) {
// TestApplications receive their Validator via the inbound connection.
connection->GetInterface(&validator_);
- connection1_ = shell_->Connect("test:service");
+ connection1_ = connector_->Connect("test:service");
connection1_->SetRemoteInterfaceProviderConnectionErrorHandler(
base::Bind(&TestApplication::ConnectionClosed,
base::Unretained(this), "test:service"));
- connection2_ = shell_->Connect("test:service2");
+ connection2_ = connector_->Connect("test:service2");
connection2_->SetRemoteInterfaceProviderConnectionErrorHandler(
base::Bind(&TestApplication::ConnectionClosed,
base::Unretained(this), "test:service2"));
« no previous file with comments | « mojo/shell/tests/capability_filter_test.h ('k') | mojo/shell/tests/package_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698