Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(334)

Unified Diff: test/codegen/expect/lib/html/request_animation_frame_test.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/codegen/expect/lib/html/range_test.js ('k') | test/codegen/expect/lib/html/resource_http_test.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/codegen/expect/lib/html/request_animation_frame_test.js
diff --git a/test/codegen/expect/lib/html/request_animation_frame_test.js b/test/codegen/expect/lib/html/request_animation_frame_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..6344b5ae21e2604192fa303d74abef48208f5ebb
--- /dev/null
+++ b/test/codegen/expect/lib/html/request_animation_frame_test.js
@@ -0,0 +1,50 @@
+dart_library.library('lib/html/request_animation_frame_test', null, /* Imports */[
+ 'dart_sdk',
+ 'unittest'
+], function load__request_animation_frame_test(exports, dart_sdk, unittest) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const html = dart_sdk.html;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const html_config = unittest.html_config;
+ const unittest$ = unittest.unittest;
+ const request_animation_frame_test = Object.create(null);
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let numTovoid = () => (numTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [core.num])))();
+ request_animation_frame_test.main = function() {
+ html_config.useHtmlConfiguration();
+ unittest$.test('oneShot', dart.fn(() => {
+ let frame = html.window[dartx.requestAnimationFrame](html.FrameRequestCallback._check(unittest$.expectAsync(dart.fn(timestamp => {
+ }, dynamicTodynamic()))));
+ }, VoidTodynamic()));
+ unittest$.test('twoShot', dart.fn(() => {
+ let frame = html.window[dartx.requestAnimationFrame](html.FrameRequestCallback._check(unittest$.expectAsync(dart.fn(timestamp1 => {
+ html.window[dartx.requestAnimationFrame](html.FrameRequestCallback._check(unittest$.expectAsync(dart.fn(timestamp2 => {
+ }, dynamicTodynamic()))));
+ }, dynamicTodynamic()))));
+ }, VoidTodynamic()));
+ unittest$.test('cancel1', dart.fn(() => {
+ let frame1 = html.window[dartx.requestAnimationFrame](dart.fn(timestamp1 => {
+ dart.throw(core.Exception.new('Should have been cancelled'));
+ }, numTovoid()));
+ let frame2 = html.window[dartx.requestAnimationFrame](html.FrameRequestCallback._check(unittest$.expectAsync(dart.fn(timestamp2 => {
+ }, dynamicTodynamic()))));
+ html.window[dartx.cancelAnimationFrame](frame1);
+ }, VoidTodynamic()));
+ unittest$.test('cancel2', dart.fn(() => {
+ let frame1 = html.window[dartx.requestAnimationFrame](html.FrameRequestCallback._check(unittest$.expectAsync(dart.fn(timestamp1 => {
+ }, dynamicTodynamic()))));
+ let frame2 = html.window[dartx.requestAnimationFrame](dart.fn(timestamp2 => {
+ dart.throw(core.Exception.new('Should have been cancelled'));
+ }, numTovoid()));
+ let frame3 = html.window[dartx.requestAnimationFrame](html.FrameRequestCallback._check(unittest$.expectAsync(dart.fn(timestamp3 => {
+ }, dynamicTodynamic()))));
+ html.window[dartx.cancelAnimationFrame](frame2);
+ }, VoidTodynamic()));
+ };
+ dart.fn(request_animation_frame_test.main, VoidTodynamic());
+ // Exports:
+ exports.request_animation_frame_test = request_animation_frame_test;
+});
« no previous file with comments | « test/codegen/expect/lib/html/range_test.js ('k') | test/codegen/expect/lib/html/resource_http_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698