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 |
(...skipping 22 matching lines...) Expand all Loading... |
33 isBrowser: true, isJS: true, isBlink: true); | 33 isBrowser: true, isJS: true, isBlink: true); |
34 | 34 |
35 /// Mozilla Firefox. | 35 /// Mozilla Firefox. |
36 static const TestPlatform firefox = const TestPlatform._("Firefox", "firefox", | 36 static const TestPlatform firefox = const TestPlatform._("Firefox", "firefox", |
37 isBrowser: true, isJS: true); | 37 isBrowser: true, isJS: true); |
38 | 38 |
39 /// Apple Safari. | 39 /// Apple Safari. |
40 static const TestPlatform safari = const TestPlatform._("Safari", "safari", | 40 static const TestPlatform safari = const TestPlatform._("Safari", "safari", |
41 isBrowser: true, isJS: true); | 41 isBrowser: true, isJS: true); |
42 | 42 |
| 43 /// Microsoft Internet Explorer. |
| 44 static const TestPlatform internetExplorer = const TestPlatform._( |
| 45 "Internet Explorer", "ie", |
| 46 isBrowser: true, isJS: true); |
| 47 |
43 /// A list of all instances of [TestPlatform]. | 48 /// A list of all instances of [TestPlatform]. |
44 static const List<TestPlatform> all = | 49 static const List<TestPlatform> all = const [ |
45 const [vm, dartium, contentShell, chrome, phantomJS, firefox, safari]; | 50 vm, |
| 51 dartium, |
| 52 contentShell, |
| 53 chrome, |
| 54 phantomJS, |
| 55 firefox, |
| 56 safari, |
| 57 internetExplorer |
| 58 ]; |
46 | 59 |
47 /// Finds a platform by its identifier string. | 60 /// Finds a platform by its identifier string. |
48 /// | 61 /// |
49 /// If no platform is found, returns `null`. | 62 /// If no platform is found, returns `null`. |
50 static TestPlatform find(String identifier) => | 63 static TestPlatform find(String identifier) => |
51 all.firstWhere((platform) => platform.identifier == identifier, | 64 all.firstWhere((platform) => platform.identifier == identifier, |
52 orElse: () => null); | 65 orElse: () => null); |
53 | 66 |
54 /// The human-friendly name of the platform. | 67 /// The human-friendly name of the platform. |
55 final String name; | 68 final String name; |
(...skipping 11 matching lines...) Expand all Loading... |
67 final bool isJS; | 80 final bool isJS; |
68 | 81 |
69 /// Whether this platform uses the Blink rendering engine. | 82 /// Whether this platform uses the Blink rendering engine. |
70 final bool isBlink; | 83 final bool isBlink; |
71 | 84 |
72 const TestPlatform._(this.name, this.identifier, {this.isDartVm: false, | 85 const TestPlatform._(this.name, this.identifier, {this.isDartVm: false, |
73 this.isBrowser: false, this.isJS: false, this.isBlink: false}); | 86 this.isBrowser: false, this.isJS: false, this.isBlink: false}); |
74 | 87 |
75 String toString() => name; | 88 String toString() => name; |
76 } | 89 } |
OLD | NEW |