OLD | NEW |
1 dart_library.library('lib/html/client_rect_test', null, /* Imports */[ | 1 dart_library.library('lib/html/client_rect_test', null, /* Imports */[ |
2 'dart_sdk', | 2 'dart_sdk', |
3 'unittest' | 3 'unittest' |
4 ], function load__client_rect_test(exports, dart_sdk, unittest) { | 4 ], function load__client_rect_test(exports, dart_sdk, unittest) { |
5 'use strict'; | 5 'use strict'; |
6 const core = dart_sdk.core; | 6 const core = dart_sdk.core; |
7 const math = dart_sdk.math; | 7 const math = dart_sdk.math; |
8 const html = dart_sdk.html; | 8 const html = dart_sdk.html; |
9 const dart = dart_sdk.dart; | 9 const dart = dart_sdk.dart; |
10 const dartx = dart_sdk.dartx; | 10 const dartx = dart_sdk.dartx; |
11 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; | 11 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; |
12 const html_config = unittest.html_config; | 12 const html_config = unittest.html_config; |
13 const unittest$ = unittest.unittest; | 13 const unittest$ = unittest.unittest; |
14 const src__matcher__expect = unittest.src__matcher__expect; | 14 const src__matcher__expect = unittest.src__matcher__expect; |
15 const client_rect_test = Object.create(null); | 15 const client_rect_test = Object.create(null); |
16 let RectangleOfnum = () => (RectangleOfnum = dart.constFn(math.Rectangle$(core
.num)))(); | 16 let RectangleOfnum = () => (RectangleOfnum = dart.constFn(math.Rectangle$(core
.num)))(); |
17 let ListOfRectangleOfnum = () => (ListOfRectangleOfnum = dart.constFn(core.Lis
t$(RectangleOfnum())))(); | 17 let ListOfRectangleOfnum = () => (ListOfRectangleOfnum = dart.constFn(core.Lis
t$(RectangleOfnum())))(); |
18 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); | 18 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 19 let VoidToElement = () => (VoidToElement = dart.constFn(dart.definiteFunctionT
ype(html.Element, [])))(); |
19 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); | 20 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
20 client_rect_test.main = function() { | 21 client_rect_test.main = function() { |
21 let isRectList = src__matcher__core_matchers.predicate(dart.fn(x => ListOfRe
ctangleOfnum().is(x), dynamicTobool()), 'is a List<Rectangle>'); | 22 let isRectList = src__matcher__core_matchers.predicate(dart.fn(x => ListOfRe
ctangleOfnum().is(x), dynamicTobool()), 'is a List<Rectangle>'); |
22 function insertTestDiv() { | 23 function insertTestDiv() { |
23 let element = html.Element.tag('div'); | 24 let element = html.Element.tag('div'); |
24 element[dartx.innerHtml] = ' A large block of text should go here. Clic
k this\n block of text multiple times to see each line\n highlight with ev
ery click of the mouse button.\n '; | 25 element[dartx.innerHtml] = ' A large block of text should go here. Clic
k this\n block of text multiple times to see each line\n highlight with ev
ery click of the mouse button.\n '; |
25 html.document[dartx.body][dartx.append](element); | 26 html.document[dartx.body][dartx.append](element); |
26 return element; | 27 return element; |
27 } | 28 } |
28 dart.fn(insertTestDiv, VoidTodynamic()); | 29 dart.fn(insertTestDiv, VoidToElement()); |
29 html_config.useHtmlConfiguration(); | 30 html_config.useHtmlConfiguration(); |
30 unittest$.test("ClientRectList test", dart.fn(() => { | 31 unittest$.test("ClientRectList test", dart.fn(() => { |
31 insertTestDiv(); | 32 insertTestDiv(); |
32 let range = html.Range.new(); | 33 let range = html.Range.new(); |
33 let rects = range[dartx.getClientRects](); | 34 let rects = range[dartx.getClientRects](); |
34 src__matcher__expect.expect(rects, isRectList); | 35 src__matcher__expect.expect(rects, isRectList); |
35 }, VoidTodynamic())); | 36 }, VoidTodynamic())); |
36 }; | 37 }; |
37 dart.fn(client_rect_test.main, VoidTodynamic()); | 38 dart.fn(client_rect_test.main, VoidTodynamic()); |
38 // Exports: | 39 // Exports: |
39 exports.client_rect_test = client_rect_test; | 40 exports.client_rect_test = client_rect_test; |
40 }); | 41 }); |
OLD | NEW |