OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.backend.test_platform; | 5 library test.backend.test_platform; |
6 | 6 |
7 // TODO(nweiz): support pluggable platforms. | 7 // TODO(nweiz): support pluggable platforms. |
8 /// An enum of all platforms on which tests can run. | 8 /// An enum of all platforms on which tests can run. |
9 class TestPlatform { | 9 class TestPlatform { |
10 // When adding new platforms, be sure to update the baseline and derived | 10 // When adding new platforms, be sure to update the baseline and derived |
11 // variable tests in test/backend/platform_selector/evaluate_test. | 11 // variable tests in test/backend/platform_selector/evaluate_test. |
12 | 12 |
13 /// The command-line Dart VM. | 13 /// The command-line Dart VM. |
14 static const TestPlatform vm = | 14 static const TestPlatform vm = |
15 const TestPlatform._("VM", "vm", isDartVm: true); | 15 const TestPlatform._("VM", "vm", isDartVm: true); |
16 | 16 |
17 /// Dartium. | 17 /// Dartium. |
18 static const TestPlatform dartium = const TestPlatform._("Dartium", "dartium", | 18 static const TestPlatform dartium = const TestPlatform._("Dartium", "dartium", |
19 isBrowser: true, isBlink: true); | 19 isBrowser: true, isBlink: true); |
20 | 20 |
| 21 /// Dartium content shell. |
| 22 static const TestPlatform contentShell = const TestPlatform._( |
| 23 "Dartium Content Shell", "content-shell", |
| 24 isBrowser: true, isBlink: true); |
| 25 |
21 /// Google Chrome. | 26 /// Google Chrome. |
22 static const TestPlatform chrome = const TestPlatform._("Chrome", "chrome", | 27 static const TestPlatform chrome = const TestPlatform._("Chrome", "chrome", |
23 isBrowser: true, isJS: true, isBlink: true); | 28 isBrowser: true, isJS: true, isBlink: true); |
24 | 29 |
25 /// Mozilla Firefox. | 30 /// Mozilla Firefox. |
26 static const TestPlatform firefox = const TestPlatform._("Firefox", "firefox", | 31 static const TestPlatform firefox = const TestPlatform._("Firefox", "firefox", |
27 isBrowser: true, isJS: true); | 32 isBrowser: true, isJS: true); |
28 | 33 |
29 /// A list of all instances of [TestPlatform]. | 34 /// A list of all instances of [TestPlatform]. |
30 static const List<TestPlatform> all = const [vm, dartium, chrome, firefox]; | 35 static const List<TestPlatform> all = |
| 36 const [vm, dartium, contentShell, chrome, firefox]; |
31 | 37 |
32 /// Finds a platform by its identifier string. | 38 /// Finds a platform by its identifier string. |
33 /// | 39 /// |
34 /// If no platform is found, returns `null`. | 40 /// If no platform is found, returns `null`. |
35 static TestPlatform find(String identifier) => | 41 static TestPlatform find(String identifier) => |
36 all.firstWhere((platform) => platform.identifier == identifier, | 42 all.firstWhere((platform) => platform.identifier == identifier, |
37 orElse: () => null); | 43 orElse: () => null); |
38 | 44 |
39 /// The human-friendly name of the platform. | 45 /// The human-friendly name of the platform. |
40 final String name; | 46 final String name; |
(...skipping 11 matching lines...) Expand all Loading... |
52 final bool isJS; | 58 final bool isJS; |
53 | 59 |
54 /// Whether this platform uses the Blink rendering engine. | 60 /// Whether this platform uses the Blink rendering engine. |
55 final bool isBlink; | 61 final bool isBlink; |
56 | 62 |
57 const TestPlatform._(this.name, this.identifier, {this.isDartVm: false, | 63 const TestPlatform._(this.name, this.identifier, {this.isDartVm: false, |
58 this.isBrowser: false, this.isJS: false, this.isBlink: false}); | 64 this.isBrowser: false, this.isJS: false, this.isBlink: false}); |
59 | 65 |
60 String toString() => name; | 66 String toString() => name; |
61 } | 67 } |
OLD | NEW |