| 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, isDartVM: true); | 19 isBrowser: true, isBlink: true, isDartVM: true); |
| 20 | 20 |
| 21 /// Dartium content shell. | 21 /// Dartium content shell. |
| 22 static const TestPlatform contentShell = const TestPlatform._( | 22 static const TestPlatform contentShell = const TestPlatform._( |
| 23 "Dartium Content Shell", "content-shell", | 23 "Dartium Content Shell", "content-shell", |
| 24 isBrowser: true, isBlink: true, isDartVM: true); | 24 isBrowser: true, isBlink: true, isDartVM: true, isHeadless: true); |
| 25 | 25 |
| 26 /// Google Chrome. | 26 /// Google Chrome. |
| 27 static const TestPlatform chrome = const TestPlatform._("Chrome", "chrome", | 27 static const TestPlatform chrome = const TestPlatform._("Chrome", "chrome", |
| 28 isBrowser: true, isJS: true, isBlink: true); | 28 isBrowser: true, isJS: true, isBlink: true); |
| 29 | 29 |
| 30 /// PhantomJS. | 30 /// PhantomJS. |
| 31 static const TestPlatform phantomJS = const TestPlatform._( | 31 static const TestPlatform phantomJS = const TestPlatform._( |
| 32 "PhantomJS", "phantomjs", | 32 "PhantomJS", "phantomjs", |
| 33 isBrowser: true, isJS: true, isBlink: true); | 33 isBrowser: true, isJS: true, isBlink: true, isHeadless: 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. | 43 /// Microsoft Internet Explorer. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 /// Whether this platform is a browser. | 76 /// Whether this platform is a browser. |
| 77 final bool isBrowser; | 77 final bool isBrowser; |
| 78 | 78 |
| 79 /// Whether this platform runs Dart compiled to JavaScript. | 79 /// Whether this platform runs Dart compiled to JavaScript. |
| 80 final bool isJS; | 80 final bool isJS; |
| 81 | 81 |
| 82 /// Whether this platform uses the Blink rendering engine. | 82 /// Whether this platform uses the Blink rendering engine. |
| 83 final bool isBlink; | 83 final bool isBlink; |
| 84 | 84 |
| 85 /// Whether this platform has no visible window. |
| 86 final bool isHeadless; |
| 87 |
| 85 const TestPlatform._(this.name, this.identifier, {this.isDartVM: false, | 88 const TestPlatform._(this.name, this.identifier, {this.isDartVM: false, |
| 86 this.isBrowser: false, this.isJS: false, this.isBlink: false}); | 89 this.isBrowser: false, this.isJS: false, this.isBlink: false, |
| 90 this.isHeadless: false}); |
| 87 | 91 |
| 88 String toString() => name; | 92 String toString() => name; |
| 89 } | 93 } |
| OLD | NEW |