OLD | NEW |
(Empty) | |
| 1 dart_library.library('lib/html/performance_api_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'unittest' |
| 4 ], function load__performance_api_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_individual_config = unittest.html_individual_config; |
| 11 const unittest$ = unittest.unittest; |
| 12 const src__matcher__expect = unittest.src__matcher__expect; |
| 13 const src__matcher__core_matchers = unittest.src__matcher__core_matchers; |
| 14 const src__matcher__throws_matcher = unittest.src__matcher__throws_matcher; |
| 15 const performance_api_test = Object.create(null); |
| 16 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 17 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 18 performance_api_test.main = function() { |
| 19 html_individual_config.useHtmlIndividualConfiguration(); |
| 20 unittest$.group('supported', dart.fn(() => { |
| 21 unittest$.test('supported', dart.fn(() => { |
| 22 src__matcher__expect.expect(html.Performance[dartx.supported], true); |
| 23 }, VoidTodynamic())); |
| 24 }, VoidTovoid())); |
| 25 unittest$.group('performance', dart.fn(() => { |
| 26 unittest$.test('PerformanceApi', dart.fn(() => { |
| 27 let expectation = dart.test(html.Performance[dartx.supported]) ? src__ma
tcher__core_matchers.returnsNormally : src__matcher__throws_matcher.throws; |
| 28 src__matcher__expect.expect(dart.fn(() => { |
| 29 let requestStart = html.window[dartx.performance][dartx.timing][dartx.
requestStart]; |
| 30 let responseStart = html.window[dartx.performance][dartx.timing][dartx
.responseStart]; |
| 31 let responseEnd = html.window[dartx.performance][dartx.timing][dartx.r
esponseEnd]; |
| 32 let loading = html.window[dartx.performance][dartx.timing][dartx.domLo
ading]; |
| 33 let loadedStart = html.window[dartx.performance][dartx.timing][dartx.d
omContentLoadedEventStart]; |
| 34 let loadedEnd = html.window[dartx.performance][dartx.timing][dartx.dom
ContentLoadedEventEnd]; |
| 35 let complete = html.window[dartx.performance][dartx.timing][dartx.domC
omplete]; |
| 36 let loadEventStart = html.window[dartx.performance][dartx.timing][dart
x.loadEventStart]; |
| 37 }, VoidTodynamic()), expectation); |
| 38 }, VoidTodynamic())); |
| 39 }, VoidTovoid())); |
| 40 }; |
| 41 dart.fn(performance_api_test.main, VoidTodynamic()); |
| 42 // Exports: |
| 43 exports.performance_api_test = performance_api_test; |
| 44 }); |
OLD | NEW |