OLD | NEW |
(Empty) | |
| 1 dart_library.library('lib/html/element_constructor_1_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'unittest' |
| 4 ], function load__element_constructor_1_test(exports, dart_sdk, unittest) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const html = dart_sdk.html; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const html_config = unittest.html_config; |
| 11 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; |
| 12 const unittest$ = unittest.unittest; |
| 13 const src__matcher__expect = unittest.src__matcher__expect; |
| 14 const src__matcher__string_matchers = unittest.src__matcher__string_matchers; |
| 15 const element_constructor_1_test = Object.create(null); |
| 16 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 17 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 18 element_constructor_1_test.main = function() { |
| 19 html_config.useHtmlConfiguration(); |
| 20 let isAnchorElement = src__matcher__core_matchers.predicate(dart.fn(x => htm
l.AnchorElement.is(x), dynamicTobool()), 'is an AnchorElement'); |
| 21 let isAreaElement = src__matcher__core_matchers.predicate(dart.fn(x => html.
AreaElement.is(x), dynamicTobool()), 'is an AreaElement'); |
| 22 let isDivElement = src__matcher__core_matchers.predicate(dart.fn(x => html.D
ivElement.is(x), dynamicTobool()), 'is a DivElement'); |
| 23 let isCanvasElement = src__matcher__core_matchers.predicate(dart.fn(x => htm
l.CanvasElement.is(x), dynamicTobool()), 'is a CanvasElement'); |
| 24 let isParagraphElement = src__matcher__core_matchers.predicate(dart.fn(x =>
html.ParagraphElement.is(x), dynamicTobool()), 'is a ParagraphElement'); |
| 25 let isSpanElement = src__matcher__core_matchers.predicate(dart.fn(x => html.
SpanElement.is(x), dynamicTobool()), 'is a SpanElement'); |
| 26 let isSelectElement = src__matcher__core_matchers.predicate(dart.fn(x => htm
l.SelectElement.is(x), dynamicTobool()), 'is a SelectElement'); |
| 27 unittest$.test('anchor1', dart.fn(() => { |
| 28 let e = html.AnchorElement.new(); |
| 29 src__matcher__expect.expect(e, isAnchorElement); |
| 30 }, VoidTodynamic())); |
| 31 unittest$.test('anchor2', dart.fn(() => { |
| 32 let e = html.AnchorElement.new({href: '#blah'}); |
| 33 src__matcher__expect.expect(e, isAnchorElement); |
| 34 src__matcher__expect.expect(e[dartx.href], src__matcher__string_matchers.e
ndsWith('#blah')); |
| 35 }, VoidTodynamic())); |
| 36 unittest$.test('area', dart.fn(() => { |
| 37 let e = html.AreaElement.new(); |
| 38 src__matcher__expect.expect(e, isAreaElement); |
| 39 }, VoidTodynamic())); |
| 40 unittest$.test('div', dart.fn(() => { |
| 41 let e = html.DivElement.new(); |
| 42 src__matcher__expect.expect(e, isDivElement); |
| 43 }, VoidTodynamic())); |
| 44 unittest$.test('canvas1', dart.fn(() => { |
| 45 let e = html.CanvasElement.new(); |
| 46 src__matcher__expect.expect(e, isCanvasElement); |
| 47 }, VoidTodynamic())); |
| 48 unittest$.test('canvas2', dart.fn(() => { |
| 49 let e = html.CanvasElement.new({height: 100, width: 200}); |
| 50 src__matcher__expect.expect(e, isCanvasElement); |
| 51 src__matcher__expect.expect(e[dartx.width], 200); |
| 52 src__matcher__expect.expect(e[dartx.height], 100); |
| 53 }, VoidTodynamic())); |
| 54 unittest$.test('p', dart.fn(() => { |
| 55 let e = html.ParagraphElement.new(); |
| 56 src__matcher__expect.expect(e, isParagraphElement); |
| 57 }, VoidTodynamic())); |
| 58 unittest$.test('span', dart.fn(() => { |
| 59 let e = html.SpanElement.new(); |
| 60 src__matcher__expect.expect(e, isSpanElement); |
| 61 }, VoidTodynamic())); |
| 62 unittest$.test('select', dart.fn(() => { |
| 63 let e = html.SelectElement.new(); |
| 64 src__matcher__expect.expect(e, isSelectElement); |
| 65 }, VoidTodynamic())); |
| 66 }; |
| 67 dart.fn(element_constructor_1_test.main, VoidTodynamic()); |
| 68 // Exports: |
| 69 exports.element_constructor_1_test = element_constructor_1_test; |
| 70 }); |
OLD | NEW |