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

Side by Side Diff: lib/src/runner/plugin/hack_register_platform.dart

Issue 1731503002: Add a hack to globally register a platform plugin. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « lib/src/runner/loader.dart ('k') | pubspec.yaml » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « lib/src/runner/loader.dart ('k') | pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698