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

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

Issue 2939063002: Strong mode cleaning of many dart2js tests. (Closed)
Patch Set: Use ClassElement. Created 3 years, 6 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) 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 tests.dart2js.interop_anonymous_unreachable_test; 5 library tests.dart2js.interop_anonymous_unreachable_test;
6 6
7 import 'dart:async';
8
9 import 'package:test/test.dart'; 7 import 'package:test/test.dart';
10 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
11 9
12 main() { 10 main() {
13 test("unreachable code doesn't crash the compiler", () async { 11 test("unreachable code doesn't crash the compiler", () async {
14 // This test is a regression for Issue #24974 12 // This test is a regression for Issue #24974
15 String generated = await compile( 13 String generated = await compile(
16 """ 14 """
17 import 'package:js/js.dart'; 15 import 'package:js/js.dart';
18 16
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 165
168 generated = await compile(program2, returnAll: true); 166 generated = await compile(program2, returnAll: true);
169 expect(generated.contains("UniqueLongNameForTesting_A"), isTrue); 167 expect(generated.contains("UniqueLongNameForTesting_A"), isTrue);
170 // This extra check is to make sure that we don't include HTMLAudioElement 168 // This extra check is to make sure that we don't include HTMLAudioElement
171 // just because of the is-check. It is optimized away in this case because 169 // just because of the is-check. It is optimized away in this case because
172 // we believe it was never instantiated. 170 // we believe it was never instantiated.
173 expect(generated.contains("HTMLAudioElement"), isFalse); 171 expect(generated.contains("HTMLAudioElement"), isFalse);
174 }); 172 });
175 }); 173 });
176 } 174 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698