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

Unified Diff: tests/standalone/status_expression_test.dart

Issue 2901923003: Replace the configuration map with a typed object. (Closed)
Patch Set: Revise. Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/standalone/standalone.status ('k') | tools/testing/dart/browser_controller.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/status_expression_test.dart
diff --git a/tests/standalone/status_expression_test.dart b/tests/standalone/status_expression_test.dart
index 870670674ad5f7984f993eb63e555bb88962b311..98429ae5cbf922eb70082fd220b494a73c1e71d6 100644
--- a/tests/standalone/status_expression_test.dart
+++ b/tests/standalone/status_expression_test.dart
@@ -2,11 +2,22 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-library StatusExpressionTest;
-
import "package:expect/expect.dart";
+
+import "../../tools/testing/dart/environment.dart";
import "../../tools/testing/dart/status_expression.dart";
+class TestEnvironment implements Environment {
+ final Map<String, String> _values;
+
+ TestEnvironment(this._values);
+
+ /// Looks up the value of the variable with [name].
+ String lookUp(String name) => _values[name];
+
+ operator []=(String key, String value) => _values[key] = value;
+}
+
main() {
testExpression();
testSyntaxError();
@@ -22,7 +33,7 @@ void testExpression() {
expression.toString());
// Test BooleanExpression.evaluate().
- var environment = <String, dynamic>{"arch": "dartc", "mode": "debug"};
+ var environment = new TestEnvironment({"arch": "dartc", "mode": "debug"});
Expect.isTrue(expression.evaluate(environment));
environment["mode"] = "release";
@@ -49,11 +60,8 @@ void testBoolean() {
expression.toString());
// Test BooleanExpression.evaluate().
- var environment = <String, dynamic>{
- "arch": "ia32",
- "checked": true,
- "mode": "debug"
- };
+ var environment =
+ new TestEnvironment({"arch": "ia32", "checked": "true", "mode": "debug"});
Expect.isTrue(expression.evaluate(environment));
environment["mode"] = "release";
@@ -75,10 +83,10 @@ void testNotEqual() {
r"(($compiler == dart2js) && ($runtime != ie9))", expression.toString());
// Test BooleanExpression.evaluate().
- var environment = <String, dynamic>{
+ var environment = new TestEnvironment({
"compiler": "none",
"runtime": "ie9",
- };
+ });
Expect.isFalse(expression.evaluate(environment));
environment["runtime"] = "chrome";
« no previous file with comments | « tests/standalone/standalone.status ('k') | tools/testing/dart/browser_controller.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698