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

Side by Side Diff: mojo/services/public/cpp/view_manager/tests/view_manager_unittest.cc

Issue 741453002: Make sure that Content Handled application can be connected multiple times. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix sky Created 6 years 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 "mojo/services/public/cpp/view_manager/view_manager.h" 5 #include "mojo/services/public/cpp/view_manager/view_manager.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "mojo/application_manager/application_manager.h" 10 #include "mojo/application_manager/application_manager.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 private: 56 private:
57 // Overridden from ApplicationDelegate: 57 // Overridden from ApplicationDelegate:
58 void Initialize(ApplicationImpl* app) override { 58 void Initialize(ApplicationImpl* app) override {
59 view_manager_client_factory_.reset( 59 view_manager_client_factory_.reset(
60 new ViewManagerClientFactory(app->shell(), this)); 60 new ViewManagerClientFactory(app->shell(), this));
61 } 61 }
62 62
63 // Overridden from ApplicationLoader: 63 // Overridden from ApplicationLoader:
64 void Load(ApplicationManager* manager, 64 void Load(ApplicationManager* manager,
65 const GURL& url, 65 const GURL& url,
66 scoped_refptr<LoadCallbacks> callbacks) override { 66 ScopedMessagePipeHandle shell_handle,
67 ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); 67 LoadCallback callback) override {
68 if (!shell_handle.is_valid()) 68 ASSERT_TRUE(shell_handle.is_valid());
69 return; 69 scoped_ptr<ApplicationImpl> app(
70 scoped_ptr<ApplicationImpl> app(new ApplicationImpl(this, 70 new ApplicationImpl(this, shell_handle.Pass()));
71 shell_handle.Pass()));
72 apps_.push_back(app.release()); 71 apps_.push_back(app.release());
73 } 72 }
74 73
75 void OnApplicationError(ApplicationManager* manager, 74 void OnApplicationError(ApplicationManager* manager,
76 const GURL& url) override {} 75 const GURL& url) override {}
77 76
78 bool ConfigureIncomingConnection(ApplicationConnection* connection) override { 77 bool ConfigureIncomingConnection(ApplicationConnection* connection) override {
79 connection->AddService(view_manager_client_factory_.get()); 78 connection->AddService(view_manager_client_factory_.get());
80 return true; 79 return true;
81 } 80 }
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 644
646 // TODO(beng): tests for focus: 645 // TODO(beng): tests for focus:
647 // - focus between two views known to a connection 646 // - focus between two views known to a connection
648 // - focus between views unknown to one of the connections. 647 // - focus between views unknown to one of the connections.
649 // - focus between views unknown to either connection. 648 // - focus between views unknown to either connection.
650 649
651 // TODO(sky): need test of root being destroyed with existing views. See 650 // TODO(sky): need test of root being destroyed with existing views. See
652 // 434555 for specific case. 651 // 434555 for specific case.
653 652
654 } // namespace mojo 653 } // namespace mojo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698