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

Side by Side Diff: mojo/public/dart/src/application.dart

Issue 971083002: Create an apptesting framework for dart. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Make the apptest runner work. 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 part of application; 5 part of application;
6 6
7 class _ApplicationImpl implements application_mojom.Application { 7 class _ApplicationImpl implements application_mojom.Application {
8 application_mojom.ApplicationStub _stub; 8 application_mojom.ApplicationStub _stub;
9 shell_mojom.ShellProxy shell; 9 shell_mojom.ShellProxy shell;
10 Application _application; 10 Application _application;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 close(); 88 close();
89 } 89 }
90 90
91 void close() { 91 void close() {
92 assert(_applicationImpl != null); 92 assert(_applicationImpl != null);
93 _applicationConnections.forEach((c) => c.close()); 93 _applicationConnections.forEach((c) => c.close());
94 _applicationConnections.clear(); 94 _applicationConnections.clear();
95 _applicationImpl.close(); 95 _applicationImpl.close();
96 } 96 }
97 97
98 // This method closes all the application connections. Used during apptesting.
99 resetConnections() {
100 assert(_applicationImpl != null);
101 _applicationConnections.forEach((c) => c.close());
102 _applicationConnections.clear();
103 }
104
98 void _acceptConnection(String requestorUrl, ServiceProviderStub services, 105 void _acceptConnection(String requestorUrl, ServiceProviderStub services,
99 ServiceProviderProxy exposedServices) { 106 ServiceProviderProxy exposedServices) {
100 var connection = new ApplicationConnection(services, exposedServices); 107 var connection = new ApplicationConnection(services, exposedServices);
101 _applicationConnections.add(connection); 108 _applicationConnections.add(connection);
102 acceptConnection(requestorUrl, connection); 109 acceptConnection(requestorUrl, connection);
103 } 110 }
104 111
105 // Override this method to provide services on |connection|. 112 // Override this method to provide services on |connection|.
106 // If you provide at least one service or set fallbackServiceProvider, 113 // If you provide at least one service or set fallbackServiceProvider,
107 // then you must invoke connection.listen(). 114 // then you must invoke connection.listen().
108 void acceptConnection(String requestorUrl, ApplicationConnection connection) { 115 void acceptConnection(String requestorUrl, ApplicationConnection connection) {
109 } 116 }
110 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698