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

Unified Diff: mojo/shell/external_application_listener_unittest.cc

Issue 726743002: Fix external_application_unittests and add to mojob.py (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: allow my unittests to compile into an empty test suite on Windows Created 6 years, 1 month 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/BUILD.gn ('k') | mojo/shell/external_application_test_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/external_application_listener_unittest.cc
diff --git a/mojo/shell/external_application_listener_unittest.cc b/mojo/shell/external_application_listener_unittest.cc
index a646671aa84f8c081256a0ebe738d2b3fae562d6..943331238b2edb6bb07de0a864af69c321951883 100644
--- a/mojo/shell/external_application_listener_unittest.cc
+++ b/mojo/shell/external_application_listener_unittest.cc
@@ -8,6 +8,7 @@
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
#include "base/threading/thread.h"
+#include "mojo/application_manager/application_loader.h"
#include "mojo/application_manager/application_manager.h"
#include "mojo/common/common_type_converters.h"
#include "mojo/public/interfaces/application/application.mojom.h"
@@ -25,11 +26,26 @@
namespace mojo {
namespace shell {
+class NotAnApplicationLoader : public ApplicationLoader {
+ public:
+ NotAnApplicationLoader() {}
+ ~NotAnApplicationLoader() override {}
+
+ void Load(ApplicationManager* application_manager,
+ const GURL& url,
+ scoped_refptr<LoadCallbacks> callbacks) override {
+ NOTREACHED();
+ }
+
+ void OnApplicationError(ApplicationManager* manager,
+ const GURL& url) override {
+ NOTREACHED();
+ }
+};
+
class ExternalApplicationListenerTest : public testing::Test {
public:
- ExternalApplicationListenerTest()
- : io_thread_("io thread"),
- application_manager_(&delegate_) {}
+ ExternalApplicationListenerTest() : io_thread_("io thread") {}
~ExternalApplicationListenerTest() override {}
void SetUp() override {
@@ -49,8 +65,6 @@ class ExternalApplicationListenerTest : public testing::Test {
base::Thread io_thread_;
base::ScopedTempDir temp_dir_;
- ApplicationManager::Delegate delegate_;
- ApplicationManager application_manager_;
base::FilePath socket_path_;
scoped_ptr<ExternalApplicationListener> listener_;
};
@@ -209,10 +223,14 @@ void DestroyOnIOThread(scoped_ptr<FakeExternalApplication> doomed1,
// Create two external applications, have them discover and connect to
// the registrar, and then have one app connect to the other by URL.
TEST_F(ExternalApplicationListenerTest, ConnectTwoExternalApplications) {
+ ApplicationManager::Delegate delegate;
+ ApplicationManager application_manager(&delegate);
+ application_manager.set_default_loader(
+ scoped_ptr<ApplicationLoader>(new NotAnApplicationLoader));
+
listener_->ListenInBackground(
- socket_path_,
- base::Bind(&ApplicationManager::RegisterExternalApplication,
- base::Unretained(&application_manager_)));
+ socket_path_, base::Bind(&ApplicationManager::RegisterExternalApplication,
+ base::Unretained(&application_manager)));
listener_->WaitForListening();
// Create two external apps.
« no previous file with comments | « mojo/shell/BUILD.gn ('k') | mojo/shell/external_application_test_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698