Chromium Code Reviews| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 import 'dart:collection'; | |
| 6 | |
| 7 import '../../backend/test_platform.dart'; | |
| 8 import '../../utils.dart'; | |
| 9 import 'platform.dart'; | |
| 10 | |
| 11 /// The functions to use to load [_platformPlugins] in all loaders. | |
| 12 /// | |
| 13 /// **Do not access this outside the test package**. | |
| 14 final platformCallbacks = | |
| 15 new UnmodifiableMapView<TestPlatform, AsyncFunction>(_platformCallbacks); | |
| 16 final _platformCallbacks = <TestPlatform, AsyncFunction>{}; | |
| 17 | |
| 18 /// **Do not call this function without express permission from the test package | |
| 19 /// authors**. | |
| 20 /// | |
| 21 /// Registers a [PlatformPlugin] for [platforms]. | |
| 22 /// | |
| 23 /// This globally registers a plugin for all [Loader]s. When the runner first | |
| 24 /// requests that a suite be loaded for one of the given platforms, this will | |
| 25 /// call [getPlugin] to load the platform plugin. It may return either a | |
| 26 /// [PlatformPlugin] or a [Future<PlatformPlugin>]. That plugin is then | |
| 27 /// preserved and used to load all suites for all matching platforms. | |
| 28 /// | |
| 29 /// This overwrites the default plugins for those platforms. | |
| 30 void registerPlatformPlugin(Iterable<TestPlatform> platforms, getPlugin()) { | |
| 
 
kevmoo
2016/02/23 22:54:50
Feels weird that getPlugin() doesn't take in an ar
 
nweiz
2016/02/24 00:21:22
What arg do you expect it to take in?
 
kevmoo
2016/02/24 00:28:54
The platform? – although I guess you can call this
 
 | |
| 31 for (var platform in platforms) { | |
| 32 _platformCallbacks[platform] = getPlugin; | |
| 33 } | |
| 34 } | |
| OLD | NEW |