OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 package tests | 5 package tests |
6 | 6 |
7 import ( | 7 import ( |
8 "fmt" | 8 "fmt" |
9 "sync" | 9 "sync" |
10 "testing" | 10 "testing" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 } | 104 } |
105 | 105 |
106 func (delegate *EchoDelegate) Quit() {} | 106 func (delegate *EchoDelegate) Quit() {} |
107 | 107 |
108 // shellImpl forward connection from local EchoDelegate instance to remote. | 108 // shellImpl forward connection from local EchoDelegate instance to remote. |
109 type shellImpl struct { | 109 type shellImpl struct { |
110 remoteApp *mojoApp.Application_Proxy | 110 remoteApp *mojoApp.Application_Proxy |
111 localURL string | 111 localURL string |
112 } | 112 } |
113 | 113 |
114 func (s *shellImpl) ConnectToApplication(URL string, services *sp.ServiceProvide
r_Request, exposedServices *sp.ServiceProvider_Pointer) error { | 114 func (s *shellImpl) ConnectToApplication(URL string, services sp.ServiceProvider
_Request) error { |
115 if URL != pairedURL(s.localURL) { | 115 if URL != pairedURL(s.localURL) { |
116 return fmt.Errorf("invalid URL: want %v, got %v", pairedURL(s.lo
calURL), URL) | 116 return fmt.Errorf("invalid URL: want %v, got %v", pairedURL(s.lo
calURL), URL) |
117 } | 117 } |
118 » s.remoteApp.AcceptConnection(s.localURL, services, exposedServices, pair
edURL(s.localURL)) | 118 » s.remoteApp.AcceptConnection(s.localURL, pairedURL(s.localURL), services
) |
119 return nil | 119 return nil |
120 } | 120 } |
121 | 121 |
122 func (s *shellImpl) CreateApplicationConnector(applicationConnectorRequest ac.Ap
plicationConnector_Request) error { | 122 func (s *shellImpl) CreateApplicationConnector(applicationConnectorRequest ac.Ap
plicationConnector_Request) error { |
123 // TODO(vtl): https://github.com/domokit/mojo/issues/533 | 123 // TODO(vtl): https://github.com/domokit/mojo/issues/533 |
124 panic("not implemented") | 124 panic("not implemented") |
125 } | 125 } |
126 | 126 |
127 func TestApplication(t *testing.T) { | 127 func TestApplication(t *testing.T) { |
128 var apps []*mojoApp.Application_Proxy | 128 var apps []*mojoApp.Application_Proxy |
(...skipping 25 matching lines...) Expand all Loading... |
154 // Wait and then close pipes. | 154 // Wait and then close pipes. |
155 responsesSent.Wait() | 155 responsesSent.Wait() |
156 for i := 0; i < 2; i++ { | 156 for i := 0; i < 2; i++ { |
157 apps[i].RequestQuit() | 157 apps[i].RequestQuit() |
158 } | 158 } |
159 appsTerminated.Wait() | 159 appsTerminated.Wait() |
160 for i := 0; i < 2; i++ { | 160 for i := 0; i < 2; i++ { |
161 apps[i].Close_Proxy() | 161 apps[i].Close_Proxy() |
162 } | 162 } |
163 } | 163 } |
OLD | NEW |