Chromium Code Reviews| Index: tests/html/element_types_test.dart |
| diff --git a/tests/html/element_types_test.dart b/tests/html/element_types_test.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c9ad262796c4e2e8bf58d1a99e547a3d5f26ccaa |
| --- /dev/null |
| +++ b/tests/html/element_types_test.dart |
| @@ -0,0 +1,300 @@ |
| +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| +// 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 element_types; |
| +import '../../pkg/unittest/lib/unittest.dart'; |
| +import '../../pkg/unittest/lib/html_individual_config.dart'; |
| +import 'dart:html'; |
| + |
| +main() { |
| + useHtmlIndividualConfiguration(); |
| + |
| + group('supported_content', () { |
| + test('supported', () { |
| + expect(ContentElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_datalist', () { |
| + test('supported', () { |
| + expect(DataListElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_details', () { |
| + test('supported', () { |
| + expect(DetailsElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_embed', () { |
| + test('supported', () { |
| + expect(EmbedElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_keygen', () { |
| + test('supported', () { |
| + expect(KeygenElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_meter', () { |
| + test('supported', () { |
| + expect(MeterElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_object', () { |
| + test('supported', () { |
| + expect(MeterElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_output', () { |
| + test('supported', () { |
| + expect(OutputElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_progress', () { |
| + test('supported', () { |
| + expect(ProgressElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('supported_track', () { |
| + test('supported', () { |
| + expect(TrackElement.supported, true); |
| + }); |
| + }); |
| + |
| + group('constructors', () { |
| + test('a', () { |
| + expect((new AnchorElement()) is AnchorElement, true); |
|
Emily Fortuna
2012/12/27 23:06:49
this is no longer testing constructing an element
blois
2012/12/28 00:43:27
Yeah, basically the old way tested the HTML parse
|
| + }); |
| + test('area', () { |
| + expect((new AreaElement()) is AreaElement, true); |
| + }); |
| + test('audio', () { |
| + expect((new AudioElement()) is AudioElement, true); |
| + }); |
| + test('body', () { |
| + expect((new BodyElement()) is BodyElement, true); |
| + }); |
| + test('br', () { |
| + expect((new BRElement()) is BRElement, true); |
| + }); |
| + test('base', () { |
| + expect((new BaseElement()) is BaseElement, true); |
| + }); |
| + test('button', () { |
| + expect((new ButtonElement()) is ButtonElement, true); |
| + }); |
| + test('canvas', () { |
| + expect((new CanvasElement()) is CanvasElement, true); |
| + }); |
| + test('caption', () { |
| + expect((new TableCaptionElement()) is TableCaptionElement, true); |
| + }); |
| + test('content', () { |
| + expect((new ContentElement()) is ContentElement, |
| + ContentElement.supported); |
| + }); |
| + test('details', () { |
| + expect((new DetailsElement()) is DetailsElement, |
| + DetailsElement.supported); |
| + }); |
| + test('dl', () { |
| + expect((new DListElement()) is DListElement, true); |
| + }); |
| + test('datalist', () { |
| + expect((new DataListElement()) is DataListElement, |
| + DataListElement.supported); |
| + }); |
| + test('div', () { |
| + expect((new DivElement()) is DivElement, true); |
| + }); |
| + test('embed', () { |
| + expect((new EmbedElement()) is EmbedElement, EmbedElement.supported); |
| + }); |
| + test('fieldset', () { |
| + expect((new FieldSetElement()) is FieldSetElement, true); |
| + }); |
| + test('font', () { |
| + expect((new Element.tag('font')) is FontElement, true); |
| + }); |
| + test('form', () { |
| + expect((new FormElement()) is FormElement, true); |
| + }); |
| + test('frame', () { |
| + expect((new Element.tag('frame')) is FrameElement, true); |
| + }); |
| + test('frameset', () { |
| + expect((new Element.tag('frameset')) is FrameSetElement, true); |
| + }); |
| + test('head', () { |
| + expect((new HeadElement()) is HeadElement, true); |
| + }); |
| + test('hr', () { |
| + expect((new HRElement()) is HRElement, true); |
| + }); |
| + test('html', () { |
| + expect((new HtmlElement()) is HtmlElement, true); |
| + }); |
| + test('h1', () { |
| + expect((new HeadingElement.h1()) is HeadingElement, true); |
| + expect(new Element.tag('h1') is HeadingElement, true); |
| + }); |
| + test('h2', () { |
| + expect((new HeadingElement.h2()) is HeadingElement, true); |
| + expect(new Element.tag('h2') is HeadingElement, true); |
| + }); |
| + test('h3', () { |
| + expect((new HeadingElement.h3()) is HeadingElement, true); |
| + expect(new Element.tag('h3') is HeadingElement, true); |
| + }); |
| + test('h4', () { |
| + expect((new HeadingElement.h4()) is HeadingElement, true); |
| + expect(new Element.tag('h4') is HeadingElement, true); |
| + }); |
| + test('h5', () { |
| + expect((new HeadingElement.h5()) is HeadingElement, true); |
| + expect(new Element.tag('h5') is HeadingElement, true); |
| + }); |
| + test('h6', () { |
| + expect((new HeadingElement.h6()) is HeadingElement, true); |
| + expect(new Element.tag('h6') is HeadingElement, true); |
| + }); |
| + test('iframe', () { |
| + expect((new IFrameElement()) is IFrameElement, true); |
| + }); |
| + test('img', () { |
| + expect((new ImageElement()) is ImageElement, true); |
| + }); |
| + test('input', () { |
| + expect((new InputElement()) is InputElement, true); |
| + }); |
| + test('keygen', () { |
| + expect((new KeygenElement()) is KeygenElement, KeygenElement.supported); |
| + }); |
| + test('li', () { |
| + expect((new LIElement()) is LIElement, true); |
| + }); |
| + test('label', () { |
| + expect((new LabelElement()) is LabelElement, true); |
| + }); |
| + test('legend', () { |
| + expect((new LegendElement()) is LegendElement, true); |
| + }); |
| + test('link', () { |
| + expect((new LinkElement()) is LinkElement, true); |
| + }); |
| + test('map', () { |
| + expect((new MapElement()) is MapElement, true); |
| + }); |
| + test('marquee', () { |
| + expect((new Element.tag('marquee')) is MarqueeElement, |
| + MarqueeElement.supported); |
| + }); |
| + test('menu', () { |
| + expect((new MenuElement()) is MenuElement, true); |
| + }); |
| + test('meta', () { |
| + expect((new Element.tag('meta')) is MetaElement, true); |
| + }); |
| + test('meter', () { |
| + expect((new Element.tag('meter')) is MeterElement, MeterElement.supported); |
| + }); |
| + test('del', () { |
| + expect((new Element.tag('del')) is ModElement, true); |
| + }); |
| + test('ins', () { |
| + expect((new Element.tag('ins')) is ModElement, true); |
| + }); |
| + test('object', () { |
| + expect((new ObjectElement()) is ObjectElement, ObjectElement.supported); |
| + }); |
| + test('ol', () { |
| + expect((new OListElement()) is OListElement, true); |
| + }); |
| + test('optgroup', () { |
| + expect((new OptGroupElement()) is OptGroupElement, true); |
| + }); |
| + test('option', () { |
| + expect((new OptionElement()) is OptionElement, true); |
| + }); |
| + test('output', () { |
| + expect((new OutputElement()) is OutputElement, OutputElement.supported); |
| + }); |
| + test('p', () { |
| + expect((new ParagraphElement()) is ParagraphElement, true); |
| + }); |
| + test('param', () { |
| + expect((new ParamElement()) is ParamElement, true); |
| + }); |
| + test('pre', () { |
| + expect((new PreElement()) is PreElement, true); |
| + }); |
| + test('progress', () { |
| + expect((new ProgressElement()) is ProgressElement, |
| + ProgressElement.supported); |
| + }); |
| + test('q', () { |
| + expect((new Element.tag('q')) is QuoteElement, true); |
| + }); |
| + test('script', () { |
| + expect((new ScriptElement()) is ScriptElement, true); |
| + }); |
| + test('select', () { |
| + expect((new SelectElement()) is SelectElement, true); |
| + }); |
| + test('source', () { |
| + expect((new SourceElement()) is SourceElement, true); |
| + }); |
| + test('span', () { |
| + expect((new SpanElement()) is SpanElement, true); |
| + }); |
| + test('style', () { |
| + expect((new StyleElement()) is StyleElement, true); |
| + }); |
| + test('table', () { |
| + expect((new TableElement()) is TableElement, true); |
| + }); |
| + test('textarea', () { |
| + expect((new TextAreaElement()) is TextAreaElement, true); |
| + }); |
| + test('title', () { |
| + expect((new TitleElement()) is TitleElement, true); |
| + }); |
| + test('td', () { |
| + expect((new TableCellElement()) is TableCellElement, true); |
| + }); |
| + test('col', () { |
| + expect((new TableColElement()) is TableColElement, true); |
| + expect((new Element.tag('colgroup')) is TableColElement, true); |
| + }); |
| + test('tr', () { |
| + expect((new TableRowElement()) is TableRowElement, true); |
| + }); |
| + test('table section', () { |
| + expect((new Element.tag('tbody')) is TableSectionElement, true); |
| + expect((new Element.tag('tfoot')) is TableSectionElement, true); |
| + expect((new Element.tag('thead')) is TableSectionElement, true); |
| + }); |
| + test('track', () { |
| + expect((new Element.tag('track')) is TrackElement, |
| + TrackElement.supported); |
| + }); |
| + test('ul', () { |
| + expect((new UListElement()) is UListElement, true); |
| + }); |
| + test('video', () { |
| + expect((new VideoElement()) is VideoElement, true); |
| + }); |
| + test('unknown', () { |
| + expect((new Element.tag('someunknown')) is UnknownElement, true); |
| + });; |
| + }); |
| +} |