OLD | NEW |
---|---|
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 library trydart.incremental_compilation_update_test; | 5 library trydart.incremental_compilation_update_test; |
6 | 6 |
7 import 'dart:html' hide | 7 import 'dart:html' hide |
8 Element; | 8 Element; |
9 | 9 |
10 import 'dart:async' show | 10 import 'dart:async' show |
(...skipping 1284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1295 main() { | 1295 main() { |
1296 // TODO(ahe): Remove next line when new constants are handled correctly. | 1296 // TODO(ahe): Remove next line when new constants are handled correctly. |
1297 [].map(null); | 1297 [].map(null); |
1298 print('v1'); | 1298 print('v1'); |
1299 } | 1299 } |
1300 """, | 1300 """, |
1301 const <String>['v1']), | 1301 const <String>['v1']), |
1302 const ProgramResult( | 1302 const ProgramResult( |
1303 r""" | 1303 r""" |
1304 main() { | 1304 main() { |
1305 // TODO(ahe): Use forEach(print) when closures are computed correctly. | 1305 ['v2'].forEach(print); |
ahe
2014/11/28 11:45:19
Forgot to remove this in 740273003.
| |
1306 ['v2'].forEach((e) { print(e); }); | |
1307 } | 1306 } |
1308 """, | 1307 """, |
1309 const <String>['v2']), | 1308 const <String>['v2']), |
1310 ], | 1309 ], |
1311 ]; | 1310 ]; |
1312 | 1311 |
1313 void main() { | 1312 void main() { |
1314 listener.start(); | 1313 listener.start(); |
1315 | 1314 |
1316 document.head.append(lineNumberStyle()); | 1315 document.head.append(lineNumberStyle()); |
1317 | 1316 |
1317 summary = new SpanElement(); | |
1318 document.body.append(new HeadingElement.h1() | |
1319 ..appendText("Incremental compiler tests") | |
1320 ..append(summary)); | |
1321 | |
1318 String query = window.location.search; | 1322 String query = window.location.search; |
1319 int skip = 0; | 1323 int skip = 0; |
1320 if (query != null && query.length > 1) { | 1324 if (query != null && query.length > 1) { |
1321 query = query.substring(1); | 1325 query = query.substring(1); |
1322 String skipParam = Uri.splitQueryString(window.location.search)['skip']; | 1326 String skipParam = Uri.splitQueryString(window.location.search)['skip']; |
1323 if (skipParam != null) { | 1327 if (skipParam != null) { |
1324 skip = int.parse(skipParam); | 1328 skip = int.parse(skipParam); |
1325 } | 1329 } |
1326 } | 1330 } |
1331 testCount += skip; | |
1327 | 1332 |
1328 return asyncTest(() => Future.forEach(tests.skip(skip), compileAndRun)); | 1333 return asyncTest(() => Future.forEach(tests.skip(skip), compileAndRun) |
1334 .then(updateSummary)); | |
1329 } | 1335 } |
1330 | 1336 |
1337 SpanElement summary; | |
1338 | |
1331 int testCount = 1; | 1339 int testCount = 1; |
1332 | 1340 |
1341 void updateSummary(_) { | |
1342 summary.text = " (${testCount - 1}/${tests.length})"; | |
1343 } | |
1344 | |
1333 Future compileAndRun(List<ProgramResult> programs) { | 1345 Future compileAndRun(List<ProgramResult> programs) { |
1346 updateSummary(null); | |
1334 var status = new DivElement(); | 1347 var status = new DivElement(); |
1335 document.body.append(status); | 1348 document.body.append(status); |
1336 | 1349 |
1337 IFrameElement iframe = | 1350 IFrameElement iframe = |
1338 appendIFrame( | 1351 appendIFrame( |
1339 '/root_dart/tests/try/web/incremental_compilation_update.html', | 1352 '/root_dart/tests/try/web/incremental_compilation_update.html', |
1340 document.body) | 1353 document.body) |
1341 ..style.width = '100%' | 1354 ..style.width = '100%' |
1342 ..style.height = '600px'; | 1355 ..style.height = '600px'; |
1343 | 1356 |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1485 position: absolute; | 1498 position: absolute; |
1486 left: 0px; | 1499 left: 0px; |
1487 width: 3em; | 1500 width: 3em; |
1488 text-align: right; | 1501 text-align: right; |
1489 background-color: lightgoldenrodyellow; | 1502 background-color: lightgoldenrodyellow; |
1490 } | 1503 } |
1491 '''); | 1504 '''); |
1492 style.type = 'text/css'; | 1505 style.type = 'text/css'; |
1493 return style; | 1506 return style; |
1494 } | 1507 } |
OLD | NEW |