| 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 firefox, |
| 55 safari, |
| 56 internetExplorer |
| 57 ]; |
| 46 | 58 |
| 47 /// Finds a platform by its identifier string. | 59 /// Finds a platform by its identifier string. |
| 48 /// | 60 /// |
| 49 /// If no platform is found, returns `null`. | 61 /// If no platform is found, returns `null`. |
| 50 static TestPlatform find(String identifier) => | 62 static TestPlatform find(String identifier) => |
| 51 all.firstWhere((platform) => platform.identifier == identifier, | 63 all.firstWhere((platform) => platform.identifier == identifier, |
| 52 orElse: () => null); | 64 orElse: () => null); |
| 53 | 65 |
| 54 /// The human-friendly name of the platform. | 66 /// The human-friendly name of the platform. |
| 55 final String name; | 67 final String name; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 67 final bool isJS; | 79 final bool isJS; |
| 68 | 80 |
| 69 /// Whether this platform uses the Blink rendering engine. | 81 /// Whether this platform uses the Blink rendering engine. |
| 70 final bool isBlink; | 82 final bool isBlink; |
| 71 | 83 |
| 72 const TestPlatform._(this.name, this.identifier, {this.isDartVm: false, | 84 const TestPlatform._(this.name, this.identifier, {this.isDartVm: false, |
| 73 this.isBrowser: false, this.isJS: false, this.isBlink: false}); | 85 this.isBrowser: false, this.isJS: false, this.isBlink: false}); |
| 74 | 86 |
| 75 String toString() => name; | 87 String toString() => name; |
| 76 } | 88 } |
| OLD | NEW |