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

Side by Side Diff: shell/application_manager/application_manager_unittest.cc

Issue 983113002: ApplicationManager: Use callback to get notified on application shutdown. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/at_exit.h" 5 #include "base/at_exit.h"
6 #include "base/bind.h" 6 #include "base/bind.h"
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/memory/scoped_vector.h" 8 #include "base/memory/scoped_vector.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "mojo/public/cpp/application/application_connection.h" 10 #include "mojo/public/cpp/application/application_connection.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 GURL mapped_url = ResolveMappings(url); 396 GURL mapped_url = ResolveMappings(url);
397 // The shell automatically map mojo URLs. 397 // The shell automatically map mojo URLs.
398 if (mapped_url.scheme() == "mojo") { 398 if (mapped_url.scheme() == "mojo") {
399 url::Replacements<char> replacements; 399 url::Replacements<char> replacements;
400 replacements.SetScheme("file", url::Component(0, 4)); 400 replacements.SetScheme("file", url::Component(0, 4));
401 mapped_url = mapped_url.ReplaceComponents(replacements); 401 mapped_url = mapped_url.ReplaceComponents(replacements);
402 } 402 }
403 return mapped_url; 403 return mapped_url;
404 } 404 }
405 405
406 void OnApplicationError(const GURL& url) override {}
407
408 private: 406 private:
409 std::map<GURL, GURL> mappings_; 407 std::map<GURL, GURL> mappings_;
410 }; 408 };
411 409
412 class TestExternal : public ApplicationDelegate { 410 class TestExternal : public ApplicationDelegate {
413 public: 411 public:
414 TestExternal() : configure_incoming_connection_called_(false) {} 412 TestExternal() : configure_incoming_connection_called_(false) {}
415 413
416 void Initialize(ApplicationImpl* app) override { 414 void Initialize(ApplicationImpl* app) override {
417 initialize_args_ = app->args(); 415 initialize_args_ = app->args();
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 // test::test2 should go to scheme loader. 748 // test::test2 should go to scheme loader.
751 application_manager_->ConnectToService(GURL("test:test2?foo=bar"), 749 application_manager_->ConnectToService(GURL("test:test2?foo=bar"),
752 &test_service); 750 &test_service);
753 EXPECT_EQ(1, url_loader->num_loads()); 751 EXPECT_EQ(1, url_loader->num_loads());
754 EXPECT_EQ(1, scheme_loader->num_loads()); 752 EXPECT_EQ(1, scheme_loader->num_loads());
755 } 753 }
756 754
757 } // namespace 755 } // namespace
758 } // namespace shell 756 } // namespace shell
759 } // namespace mojo 757 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698