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 | 5 |
6 /** | 6 /** |
7 * This URL is defined in content/public/test/test_mojo_app.cc. It identifies | 7 * This URL is defined in content/public/test/test_mojo_app.cc. It identifies |
8 * content_shell's out-of-process Mojo test app. | 8 * content_shell's out-of-process Mojo test app. |
9 */ | 9 */ |
10 var TEST_APP_URL = 'system:content_mojo_test'; | 10 var TEST_APP_URL = 'system:content_mojo_test'; |
11 | 11 |
12 | 12 |
13 define('main', [ | 13 define('main', [ |
14 'mojo/public/js/core', | 14 'mojo/public/js/core', |
15 'mojo/public/js/router', | 15 'mojo/public/js/router', |
16 'mojo/shell/public/interfaces/connector.mojom', | 16 'services/shell/public/interfaces/connector.mojom', |
17 'content/public/renderer/frame_service_registry', | 17 'content/public/renderer/frame_service_registry', |
18 'content/public/test/test_mojo_service.mojom', | 18 'content/public/test/test_mojo_service.mojom', |
19 ], function (core, router, connectorMojom, serviceRegistry, testMojom) { | 19 ], function (core, router, connectorMojom, serviceRegistry, testMojom) { |
20 | 20 |
21 var connectToService = function(serviceProvider, iface) { | 21 var connectToService = function(serviceProvider, iface) { |
22 var pipe = core.createMessagePipe(); | 22 var pipe = core.createMessagePipe(); |
23 var service = new iface.proxyClass(new router.Router(pipe.handle0)); | 23 var service = new iface.proxyClass(new router.Router(pipe.handle0)); |
24 serviceProvider.getInterface(iface.name, pipe.handle1); | 24 serviceProvider.getInterface(iface.name, pipe.handle1); |
25 return service; | 25 return service; |
26 }; | 26 }; |
(...skipping 15 matching lines...) Expand all Loading... |
42 var test = connectToService(services, testMojom.TestMojoService); | 42 var test = connectToService(services, testMojom.TestMojoService); |
43 test.getRequestorName().then(function(response) { | 43 test.getRequestorName().then(function(response) { |
44 domAutomationController.send( | 44 domAutomationController.send( |
45 response.name == 'chrome://mojo-web-ui/'); | 45 response.name == 'chrome://mojo-web-ui/'); |
46 }); | 46 }); |
47 }, | 47 }, |
48 function (exposedServices) {}, | 48 function (exposedServices) {}, |
49 null); | 49 null); |
50 }; | 50 }; |
51 }); | 51 }); |
OLD | NEW |