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

Unified Diff: services/log/log_impl_unittest.cc

Issue 1973653002: Add a new way of using ServiceProviderImpl without InterfaceFactory. (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
Index: services/log/log_impl_unittest.cc
diff --git a/services/log/log_impl_unittest.cc b/services/log/log_impl_unittest.cc
index 25119728bf0e7cc60a78dc0219535f7125d40a84..8500ce12e43ffc320b1a015548e178ac0e2dde79 100644
--- a/services/log/log_impl_unittest.cc
+++ b/services/log/log_impl_unittest.cc
@@ -11,6 +11,7 @@
#include "mojo/public/c/environment/logger.h"
#include "mojo/public/cpp/application/application_impl.h"
#include "mojo/public/cpp/application/application_test_base.h"
+#include "mojo/public/cpp/application/connection_context.h"
#include "mojo/public/cpp/system/time.h"
#include "mojo/services/log/interfaces/entry.mojom.h"
#include "mojo/services/log/interfaces/log.mojom.h"
@@ -27,18 +28,28 @@ 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 {
- static std::string kConnectionURL = "mojo:log";
- return kConnectionURL;
+ return connection_context_.connection_url;
}
const std::string& GetRemoteApplicationURL() override {
- static std::string kRemoteApplicationURL = "mojo:log_impl_unittest";
- return kRemoteApplicationURL;
+ 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

Powered by Google App Engine
This is Rietveld 408576698