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

Side by Side Diff: tests/compiler/dart2js/map_tracer_keys_test.dart

Issue 2278213003: Rename the global inference task and reduce it's API surface by introducing the (Closed)
Patch Set: cl comments Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 import 'package:expect/expect.dart'; 5 import 'package:expect/expect.dart';
6 import "package:async_helper/async_helper.dart"; 6 import "package:async_helper/async_helper.dart";
7 import 'package:compiler/src/types/types.dart' 7 import 'package:compiler/src/types/types.dart'
8 show ContainerTypeMask, TypeMask; 8 show ContainerTypeMask, TypeMask;
9 9
10 import 'compiler_helper.dart'; 10 import 'compiler_helper.dart';
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 doTest(key: "aList", bail: true, initial: true); 48 doTest(key: "aList", bail: true, initial: true);
49 doTest(value: "aList", initial: true); 49 doTest(value: "aList", initial: true);
50 } 50 }
51 51
52 void doTest({String key: "'d'", String value: "5.5", bool bail: false, 52 void doTest({String key: "'d'", String value: "5.5", bool bail: false,
53 bool initial: false}) { 53 bool initial: false}) {
54 Uri uri = new Uri(scheme: 'source'); 54 Uri uri = new Uri(scheme: 'source');
55 var compiler = compilerFor(generateTest(key, value, initial), uri, 55 var compiler = compilerFor(generateTest(key, value, initial), uri,
56 expectedErrors: 0, expectedWarnings: 0); 56 expectedErrors: 0, expectedWarnings: 0);
57 asyncTest(() => compiler.run(uri).then((_) { 57 asyncTest(() => compiler.run(uri).then((_) {
58 var typesTask = compiler.typesTask; 58 var commonMasks = compiler.commonMasks;
59 var typesInferrer = typesTask.typesInferrer; 59 var typesInferrer = compiler.globalInference.typesInferrer;
60 var aDoubleType = 60 var aDoubleType =
61 typesInferrer.getTypeOfElement(findElement(compiler, 'aDouble')); 61 typesInferrer.getTypeOfElement(findElement(compiler, 'aDouble'));
62 var aListType = 62 var aListType =
63 typesInferrer.getTypeOfElement(findElement(compiler, 'aList')); 63 typesInferrer.getTypeOfElement(findElement(compiler, 'aList'));
64 64
65 Expect.equals(aDoubleType, typesTask.doubleType); 65 Expect.equals(aDoubleType, commonMasks.doubleType);
66 Expect.isTrue(aListType is ContainerTypeMask); 66 Expect.isTrue(aListType is ContainerTypeMask);
67 ContainerTypeMask container = aListType; 67 ContainerTypeMask container = aListType;
68 TypeMask elementType = container.elementType; 68 TypeMask elementType = container.elementType;
69 if (bail) { 69 if (bail) {
70 Expect.equals(elementType, typesTask.dynamicType); 70 Expect.equals(elementType, commonMasks.dynamicType);
71 } else { 71 } else {
72 Expect.equals(elementType, typesTask.uint31Type); 72 Expect.equals(elementType, commonMasks.uint31Type);
73 } 73 }
74 })); 74 }));
75 } 75 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/map_tracer_const_test.dart ('k') | tests/compiler/dart2js/map_tracer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698