| Index: test/html5_utils_test.dart
|
| diff --git a/test/html5_utils_test.dart b/test/html5_utils_test.dart
|
| index 7d0b27418d099ce8df05f98d7e28fe5657807bbb..daf1ae136c89a5dac2a2d8c5d14499f63f96e569 100644
|
| --- a/test/html5_utils_test.dart
|
| +++ b/test/html5_utils_test.dart
|
| @@ -21,27 +21,45 @@ main() {
|
| useVmConfiguration();
|
| useMockMessages();
|
|
|
| - test('types are in dart:html', () {
|
| + test('generate type test for tag -> element mapping', () {
|
| var code = new StringBuffer();
|
| code.add('import "dart:html" as html;\n');
|
| htmlElementNames.forEach((tag, className) {
|
| code.add('html.$className _$tag;\n');
|
| });
|
|
|
| - const generatedFile = 'data/output/html5_utils_test_generated.dart';
|
| - new File(generatedFile).openSync(FileMode.WRITE)
|
| + // Note: name is important for this to get picked up by run.sh
|
| + // We don't analyze here, but run.sh will analyze it.
|
| + new File('data/output/html5_utils_test_tag_bootstrap.dart')
|
| + .openSync(FileMode.WRITE)
|
| ..writeStringSync(code.toString())
|
| ..close();
|
| + });
|
| +
|
| + test('generate type test for attribute -> field mapping', () {
|
| + var code = new StringBuffer();
|
| + code.add('import "dart:html" as html;\n');
|
| + code.add('main() {\n');
|
| + htmlElementNames.forEach((tag, className) {
|
| + code.add('html.$className _$tag = null;\n');
|
| + });
|
| + var allTags = htmlElementNames.keys;
|
| + htmlAttributeTags.forEach((attr, tags) {
|
| + var renamed = elementFieldRenames[attr];
|
| + if (renamed != null) attr = renamed;
|
| +
|
| + if (tags == allHtmlElements) tags = allTags;
|
| + for (var tag in tags) {
|
| + code.add('_$tag.$attr = null;\n');
|
| + }
|
| + });
|
| + code.add('}\n');
|
|
|
| - // TODO(jmesserly): it would be good to run all of our
|
| - // dart_analyzer tests in one batch.
|
| - Process.run('dart_analyzer', '--fatal-warnings --fatal-type-errors '
|
| - '--work data/output/analyzer/ $generatedFile'.split(' '))
|
| - .then(expectAsync1((result) {
|
| - expect(result.stdout, '', result.stdout);
|
| - expect(result.stderr, '', result.stderr);
|
| - expect(result.exitCode, 0, 'expected success, but got exit code '
|
| - '${result.exitCode}');
|
| - }));
|
| + // Note: name is important for this to get picked up by run.sh
|
| + // We don't analyze here, but run.sh will analyze it.
|
| + new File('data/output/html5_utils_test_attr_bootstrap.dart')
|
| + .openSync(FileMode.WRITE)
|
| + ..writeStringSync(code.toString())
|
| + ..close();
|
| });
|
| }
|
|
|