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

Unified Diff: services/log/log_impl_unittest.cc

Issue 1975993002: Change InterfaceFactory<I>::Create() to take a ConnectionContext instead of an ApplicationConnectio… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 4 years, 7 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 | « services/log/log_impl.cc ('k') | services/log/main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/log/log_impl_unittest.cc
diff --git a/services/log/log_impl_unittest.cc b/services/log/log_impl_unittest.cc
index 8500ce12e43ffc320b1a015548e178ac0e2dde79..de6ff9b9e6909b7b007d7643fb9030e6c198b0b1 100644
--- a/services/log/log_impl_unittest.cc
+++ b/services/log/log_impl_unittest.cc
@@ -25,42 +25,16 @@ namespace {
using base::MessageLoop;
using LogImplTest = mojo::test::ApplicationTestBase;
-// We need to supply a ApplicationConnection to LogImpl::Create().
-class TestApplicationConnection : public ApplicationConnection {
- public:
- TestApplicationConnection()
- : connection_context_(ConnectionContext::Type::INCOMING,
- "mojo:log_impl_unittest",
- "mojo:log") {}
-
- const ConnectionContext& GetConnectionContext() const override {
- return connection_context_;
- }
-
- const std::string& GetConnectionURL() override {
- return connection_context_.connection_url;
- }
-
- const std::string& GetRemoteApplicationURL() override {
- return connection_context_.remote_url;
- }
-
- void SetServiceConnectorForName(ServiceConnector* service_connector,
- const std::string& name) override {}
-
- private:
- const ConnectionContext connection_context_;
-};
-
// Tests the Log service implementation by calling its AddEntry and verifying
// the log message that it "prints".
TEST_F(LogImplTest, AddEntryOutput) {
std::vector<std::string> messages;
LogPtr log;
- TestApplicationConnection app_connection;
+ ConnectionContext connection_context(ConnectionContext::Type::INCOMING,
+ "mojo:log_impl_unittest", "mojo:log");
LogImpl::Create(
- &app_connection, GetProxy(&log),
+ connection_context, GetProxy(&log),
[&messages](const std::string& message) { messages.push_back(message); });
Entry entry;
« no previous file with comments | « services/log/log_impl.cc ('k') | services/log/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698