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

Unified Diff: test/codegen/expect/lib/html/js_interop_1_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
Index: test/codegen/expect/lib/html/js_interop_1_test.js
diff --git a/test/codegen/expect/lib/html/js_interop_1_test.js b/test/codegen/expect/lib/html/js_interop_1_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..8c3999cf03a45256c68c2bb197bcef9a78ee364f
--- /dev/null
+++ b/test/codegen/expect/lib/html/js_interop_1_test.js
@@ -0,0 +1,42 @@
+dart_library.library('lib/html/js_interop_1_test', null, /* Imports */[
+ 'dart_sdk',
+ 'unittest'
+], function load__js_interop_1_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 js_interop_1_test = Object.create(null);
+ let MessageEventTovoid = () => (MessageEventTovoid = dart.constFn(dart.functionType(dart.void, [html.MessageEvent])))();
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let VoidTobool = () => (VoidTobool = dart.constFn(dart.definiteFunctionType(core.bool, [])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ js_interop_1_test.injectSource = function(code) {
+ let script = html.ScriptElement.new();
+ script[dartx.type] = 'text/javascript';
+ script[dartx.innerHtml] = core.String._check(code);
+ html.document[dartx.body][dartx.append](script);
+ };
+ dart.fn(js_interop_1_test.injectSource, dynamicTodynamic());
+ js_interop_1_test.main = function() {
+ html_config.useHtmlConfiguration();
+ let callback = null;
+ unittest$.test('js-to-dart-post-message', dart.fn(() => {
+ let subscription = null;
+ let complete = false;
+ subscription = html.window[dartx.onMessage].listen(MessageEventTovoid()._check(unittest$.expectAsyncUntil(dart.fn(e => {
+ if (dart.equals(dart.dload(e, 'data'), 'hello')) {
+ dart.dsend(subscription, 'cancel');
+ complete = true;
+ }
+ }, dynamicTodynamic()), dart.fn(() => complete, VoidTobool()))));
+ js_interop_1_test.injectSource("window.postMessage('hello', '*');");
+ }, VoidTodynamic()));
+ };
+ dart.fn(js_interop_1_test.main, VoidTodynamic());
+ // Exports:
+ exports.js_interop_1_test = js_interop_1_test;
+});
« no previous file with comments | « test/codegen/expect/lib/html/js_function_getter_trust_types_test.js ('k') | test/codegen/expect/lib/html/js_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698