Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 | |
| 5 library element_types; | |
| 6 import '../../pkg/unittest/lib/unittest.dart'; | |
| 7 import '../../pkg/unittest/lib/html_individual_config.dart'; | |
| 8 import 'dart:html'; | |
| 9 | |
| 10 main() { | |
| 11 useHtmlIndividualConfiguration(); | |
| 12 | |
| 13 group('supported_content', () { | |
| 14 test('supported', () { | |
| 15 expect(ContentElement.supported, true); | |
| 16 }); | |
| 17 }); | |
| 18 | |
| 19 group('supported_datalist', () { | |
| 20 test('supported', () { | |
| 21 expect(DataListElement.supported, true); | |
| 22 }); | |
| 23 }); | |
| 24 | |
| 25 group('supported_details', () { | |
| 26 test('supported', () { | |
| 27 expect(DetailsElement.supported, true); | |
| 28 }); | |
| 29 }); | |
| 30 | |
| 31 group('supported_embed', () { | |
| 32 test('supported', () { | |
| 33 expect(EmbedElement.supported, true); | |
| 34 }); | |
| 35 }); | |
| 36 | |
| 37 group('supported_keygen', () { | |
| 38 test('supported', () { | |
| 39 expect(KeygenElement.supported, true); | |
| 40 }); | |
| 41 }); | |
| 42 | |
| 43 group('supported_meter', () { | |
| 44 test('supported', () { | |
| 45 expect(MeterElement.supported, true); | |
| 46 }); | |
| 47 }); | |
| 48 | |
| 49 group('supported_object', () { | |
| 50 test('supported', () { | |
| 51 expect(MeterElement.supported, true); | |
| 52 }); | |
| 53 }); | |
| 54 | |
| 55 group('supported_output', () { | |
| 56 test('supported', () { | |
| 57 expect(OutputElement.supported, true); | |
| 58 }); | |
| 59 }); | |
| 60 | |
| 61 group('supported_progress', () { | |
| 62 test('supported', () { | |
| 63 expect(ProgressElement.supported, true); | |
| 64 }); | |
| 65 }); | |
| 66 | |
| 67 group('supported_track', () { | |
| 68 test('supported', () { | |
| 69 expect(TrackElement.supported, true); | |
| 70 }); | |
| 71 }); | |
| 72 | |
| 73 group('constructors', () { | |
| 74 test('a', () { | |
| 75 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
| |
| 76 }); | |
| 77 test('area', () { | |
| 78 expect((new AreaElement()) is AreaElement, true); | |
| 79 }); | |
| 80 test('audio', () { | |
| 81 expect((new AudioElement()) is AudioElement, true); | |
| 82 }); | |
| 83 test('body', () { | |
| 84 expect((new BodyElement()) is BodyElement, true); | |
| 85 }); | |
| 86 test('br', () { | |
| 87 expect((new BRElement()) is BRElement, true); | |
| 88 }); | |
| 89 test('base', () { | |
| 90 expect((new BaseElement()) is BaseElement, true); | |
| 91 }); | |
| 92 test('button', () { | |
| 93 expect((new ButtonElement()) is ButtonElement, true); | |
| 94 }); | |
| 95 test('canvas', () { | |
| 96 expect((new CanvasElement()) is CanvasElement, true); | |
| 97 }); | |
| 98 test('caption', () { | |
| 99 expect((new TableCaptionElement()) is TableCaptionElement, true); | |
| 100 }); | |
| 101 test('content', () { | |
| 102 expect((new ContentElement()) is ContentElement, | |
| 103 ContentElement.supported); | |
| 104 }); | |
| 105 test('details', () { | |
| 106 expect((new DetailsElement()) is DetailsElement, | |
| 107 DetailsElement.supported); | |
| 108 }); | |
| 109 test('dl', () { | |
| 110 expect((new DListElement()) is DListElement, true); | |
| 111 }); | |
| 112 test('datalist', () { | |
| 113 expect((new DataListElement()) is DataListElement, | |
| 114 DataListElement.supported); | |
| 115 }); | |
| 116 test('div', () { | |
| 117 expect((new DivElement()) is DivElement, true); | |
| 118 }); | |
| 119 test('embed', () { | |
| 120 expect((new EmbedElement()) is EmbedElement, EmbedElement.supported); | |
| 121 }); | |
| 122 test('fieldset', () { | |
| 123 expect((new FieldSetElement()) is FieldSetElement, true); | |
| 124 }); | |
| 125 test('font', () { | |
| 126 expect((new Element.tag('font')) is FontElement, true); | |
| 127 }); | |
| 128 test('form', () { | |
| 129 expect((new FormElement()) is FormElement, true); | |
| 130 }); | |
| 131 test('frame', () { | |
| 132 expect((new Element.tag('frame')) is FrameElement, true); | |
| 133 }); | |
| 134 test('frameset', () { | |
| 135 expect((new Element.tag('frameset')) is FrameSetElement, true); | |
| 136 }); | |
| 137 test('head', () { | |
| 138 expect((new HeadElement()) is HeadElement, true); | |
| 139 }); | |
| 140 test('hr', () { | |
| 141 expect((new HRElement()) is HRElement, true); | |
| 142 }); | |
| 143 test('html', () { | |
| 144 expect((new HtmlElement()) is HtmlElement, true); | |
| 145 }); | |
| 146 test('h1', () { | |
| 147 expect((new HeadingElement.h1()) is HeadingElement, true); | |
| 148 expect(new Element.tag('h1') is HeadingElement, true); | |
| 149 }); | |
| 150 test('h2', () { | |
| 151 expect((new HeadingElement.h2()) is HeadingElement, true); | |
| 152 expect(new Element.tag('h2') is HeadingElement, true); | |
| 153 }); | |
| 154 test('h3', () { | |
| 155 expect((new HeadingElement.h3()) is HeadingElement, true); | |
| 156 expect(new Element.tag('h3') is HeadingElement, true); | |
| 157 }); | |
| 158 test('h4', () { | |
| 159 expect((new HeadingElement.h4()) is HeadingElement, true); | |
| 160 expect(new Element.tag('h4') is HeadingElement, true); | |
| 161 }); | |
| 162 test('h5', () { | |
| 163 expect((new HeadingElement.h5()) is HeadingElement, true); | |
| 164 expect(new Element.tag('h5') is HeadingElement, true); | |
| 165 }); | |
| 166 test('h6', () { | |
| 167 expect((new HeadingElement.h6()) is HeadingElement, true); | |
| 168 expect(new Element.tag('h6') is HeadingElement, true); | |
| 169 }); | |
| 170 test('iframe', () { | |
| 171 expect((new IFrameElement()) is IFrameElement, true); | |
| 172 }); | |
| 173 test('img', () { | |
| 174 expect((new ImageElement()) is ImageElement, true); | |
| 175 }); | |
| 176 test('input', () { | |
| 177 expect((new InputElement()) is InputElement, true); | |
| 178 }); | |
| 179 test('keygen', () { | |
| 180 expect((new KeygenElement()) is KeygenElement, KeygenElement.supported); | |
| 181 }); | |
| 182 test('li', () { | |
| 183 expect((new LIElement()) is LIElement, true); | |
| 184 }); | |
| 185 test('label', () { | |
| 186 expect((new LabelElement()) is LabelElement, true); | |
| 187 }); | |
| 188 test('legend', () { | |
| 189 expect((new LegendElement()) is LegendElement, true); | |
| 190 }); | |
| 191 test('link', () { | |
| 192 expect((new LinkElement()) is LinkElement, true); | |
| 193 }); | |
| 194 test('map', () { | |
| 195 expect((new MapElement()) is MapElement, true); | |
| 196 }); | |
| 197 test('marquee', () { | |
| 198 expect((new Element.tag('marquee')) is MarqueeElement, | |
| 199 MarqueeElement.supported); | |
| 200 }); | |
| 201 test('menu', () { | |
| 202 expect((new MenuElement()) is MenuElement, true); | |
| 203 }); | |
| 204 test('meta', () { | |
| 205 expect((new Element.tag('meta')) is MetaElement, true); | |
| 206 }); | |
| 207 test('meter', () { | |
| 208 expect((new Element.tag('meter')) is MeterElement, MeterElement.supported) ; | |
| 209 }); | |
| 210 test('del', () { | |
| 211 expect((new Element.tag('del')) is ModElement, true); | |
| 212 }); | |
| 213 test('ins', () { | |
| 214 expect((new Element.tag('ins')) is ModElement, true); | |
| 215 }); | |
| 216 test('object', () { | |
| 217 expect((new ObjectElement()) is ObjectElement, ObjectElement.supported); | |
| 218 }); | |
| 219 test('ol', () { | |
| 220 expect((new OListElement()) is OListElement, true); | |
| 221 }); | |
| 222 test('optgroup', () { | |
| 223 expect((new OptGroupElement()) is OptGroupElement, true); | |
| 224 }); | |
| 225 test('option', () { | |
| 226 expect((new OptionElement()) is OptionElement, true); | |
| 227 }); | |
| 228 test('output', () { | |
| 229 expect((new OutputElement()) is OutputElement, OutputElement.supported); | |
| 230 }); | |
| 231 test('p', () { | |
| 232 expect((new ParagraphElement()) is ParagraphElement, true); | |
| 233 }); | |
| 234 test('param', () { | |
| 235 expect((new ParamElement()) is ParamElement, true); | |
| 236 }); | |
| 237 test('pre', () { | |
| 238 expect((new PreElement()) is PreElement, true); | |
| 239 }); | |
| 240 test('progress', () { | |
| 241 expect((new ProgressElement()) is ProgressElement, | |
| 242 ProgressElement.supported); | |
| 243 }); | |
| 244 test('q', () { | |
| 245 expect((new Element.tag('q')) is QuoteElement, true); | |
| 246 }); | |
| 247 test('script', () { | |
| 248 expect((new ScriptElement()) is ScriptElement, true); | |
| 249 }); | |
| 250 test('select', () { | |
| 251 expect((new SelectElement()) is SelectElement, true); | |
| 252 }); | |
| 253 test('source', () { | |
| 254 expect((new SourceElement()) is SourceElement, true); | |
| 255 }); | |
| 256 test('span', () { | |
| 257 expect((new SpanElement()) is SpanElement, true); | |
| 258 }); | |
| 259 test('style', () { | |
| 260 expect((new StyleElement()) is StyleElement, true); | |
| 261 }); | |
| 262 test('table', () { | |
| 263 expect((new TableElement()) is TableElement, true); | |
| 264 }); | |
| 265 test('textarea', () { | |
| 266 expect((new TextAreaElement()) is TextAreaElement, true); | |
| 267 }); | |
| 268 test('title', () { | |
| 269 expect((new TitleElement()) is TitleElement, true); | |
| 270 }); | |
| 271 test('td', () { | |
| 272 expect((new TableCellElement()) is TableCellElement, true); | |
| 273 }); | |
| 274 test('col', () { | |
| 275 expect((new TableColElement()) is TableColElement, true); | |
| 276 expect((new Element.tag('colgroup')) is TableColElement, true); | |
| 277 }); | |
| 278 test('tr', () { | |
| 279 expect((new TableRowElement()) is TableRowElement, true); | |
| 280 }); | |
| 281 test('table section', () { | |
| 282 expect((new Element.tag('tbody')) is TableSectionElement, true); | |
| 283 expect((new Element.tag('tfoot')) is TableSectionElement, true); | |
| 284 expect((new Element.tag('thead')) is TableSectionElement, true); | |
| 285 }); | |
| 286 test('track', () { | |
| 287 expect((new Element.tag('track')) is TrackElement, | |
| 288 TrackElement.supported); | |
| 289 }); | |
| 290 test('ul', () { | |
| 291 expect((new UListElement()) is UListElement, true); | |
| 292 }); | |
| 293 test('video', () { | |
| 294 expect((new VideoElement()) is VideoElement, true); | |
| 295 }); | |
| 296 test('unknown', () { | |
| 297 expect((new Element.tag('someunknown')) is UnknownElement, true); | |
| 298 });; | |
| 299 }); | |
| 300 } | |
| OLD | NEW |