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

Unified Diff: mojo/shell/public/cpp/tests/connection_impl_unittest.cc

Issue 1678923003: Rename ServiceConnector to InterfaceBinder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@connection
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/public/cpp/service_connector.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/public/cpp/tests/connection_impl_unittest.cc
diff --git a/mojo/shell/public/cpp/tests/connection_impl_unittest.cc b/mojo/shell/public/cpp/tests/connection_impl_unittest.cc
index fcac188859183ff189f5f9f36d70c12f2de87984..d93da433e0d29fe6dff00fd2369d94850f8fd7b5 100644
--- a/mojo/shell/public/cpp/tests/connection_impl_unittest.cc
+++ b/mojo/shell/public/cpp/tests/connection_impl_unittest.cc
@@ -5,20 +5,20 @@
#include "mojo/shell/public/cpp/lib/connection_impl.h"
#include "base/memory/scoped_ptr.h"
-#include "mojo/shell/public/cpp/service_connector.h"
+#include "mojo/shell/public/cpp/interface_binder.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace mojo {
namespace internal {
namespace {
-class TestConnector : public ServiceConnector {
+class TestBinder : public InterfaceBinder {
public:
- explicit TestConnector(int* delete_count) : delete_count_(delete_count) {}
- ~TestConnector() override { (*delete_count_)++; }
- void ConnectToService(Connection* connection,
- const std::string& interface_name,
- ScopedMessagePipeHandle client_handle) override {}
+ explicit TestBinder(int* delete_count) : delete_count_(delete_count) {}
+ ~TestBinder() override { (*delete_count_)++; }
+ void BindInterface(Connection* connection,
+ const std::string& interface_name,
+ ScopedMessagePipeHandle client_handle) override {}
private:
int* delete_count_;
@@ -31,18 +31,17 @@ TEST(ConnectionImplTest, Ownership) {
{
ConnectionImpl connection;
ConnectionImpl::TestApi test_api(&connection);
- test_api.SetServiceConnectorForName(new TestConnector(&delete_count),
- "TC1");
+ test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1");
}
EXPECT_EQ(1, delete_count);
// Removal.
{
scoped_ptr<ConnectionImpl> connection(new ConnectionImpl);
- ServiceConnector* c = new TestConnector(&delete_count);
+ InterfaceBinder* b = new TestBinder(&delete_count);
ConnectionImpl::TestApi test_api(connection.get());
- test_api.SetServiceConnectorForName(c, "TC1");
- test_api.RemoveServiceConnectorForName("TC1");
+ test_api.SetInterfaceBinderForName(b, "TC1");
+ test_api.RemoveInterfaceBinderForName("TC1");
connection.reset();
EXPECT_EQ(2, delete_count);
}
@@ -51,10 +50,8 @@ TEST(ConnectionImplTest, Ownership) {
{
ConnectionImpl connection;
ConnectionImpl::TestApi test_api(&connection);
- test_api.SetServiceConnectorForName(new TestConnector(&delete_count),
- "TC1");
- test_api.SetServiceConnectorForName(new TestConnector(&delete_count),
- "TC2");
+ test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1");
+ test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC2");
}
EXPECT_EQ(4, delete_count);
@@ -62,10 +59,8 @@ TEST(ConnectionImplTest, Ownership) {
{
ConnectionImpl connection;
ConnectionImpl::TestApi test_api(&connection);
- test_api.SetServiceConnectorForName(new TestConnector(&delete_count),
- "TC1");
- test_api.SetServiceConnectorForName(new TestConnector(&delete_count),
- "TC1");
+ test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1");
+ test_api.SetInterfaceBinderForName(new TestBinder(&delete_count), "TC1");
EXPECT_EQ(5, delete_count);
}
EXPECT_EQ(6, delete_count);
« no previous file with comments | « mojo/shell/public/cpp/service_connector.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698