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

Unified Diff: test/codegen/expect/lib/html/mirrors_js_typed_interop_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/messageevent_test.js ('k') | test/codegen/expect/lib/html/mouse_event_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/mirrors_js_typed_interop_test.js
diff --git a/test/codegen/expect/lib/html/mirrors_js_typed_interop_test.js b/test/codegen/expect/lib/html/mirrors_js_typed_interop_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..9557f4ee5dcf8531ade19909a5c0714aae350a5e
--- /dev/null
+++ b/test/codegen/expect/lib/html/mirrors_js_typed_interop_test.js
@@ -0,0 +1,41 @@
+dart_library.library('lib/html/mirrors_js_typed_interop_test', null, /* Imports */[
+ 'dart_sdk',
+ 'unittest'
+], function load__mirrors_js_typed_interop_test(exports, dart_sdk, unittest) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const html = dart_sdk.html;
+ const mirrors = dart_sdk.mirrors;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const html_config = unittest.html_config;
+ const unittest$ = unittest.unittest;
+ const src__matcher__expect = unittest.src__matcher__expect;
+ const src__matcher__throws_matcher = unittest.src__matcher__throws_matcher;
+ const mirrors_js_typed_interop_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let VoidToInstanceMirror = () => (VoidToInstanceMirror = dart.constFn(dart.definiteFunctionType(mirrors.InstanceMirror, [])))();
+ mirrors_js_typed_interop_test._injectJs = function() {
+ html.document[dartx.body][dartx.append]((() => {
+ let _ = html.ScriptElement.new();
+ _[dartx.type] = 'text/javascript';
+ _[dartx.innerHtml] = " window.foo = {\n x: 3,\n z: 100,\n multiplyBy2: function(arg) { return arg * 2; },\n };\n";
+ return _;
+ })());
+ };
+ dart.fn(mirrors_js_typed_interop_test._injectJs, VoidTodynamic());
+ let const$;
+ mirrors_js_typed_interop_test.main = function() {
+ mirrors_js_typed_interop_test._injectJs();
+ html_config.useHtmlConfiguration();
+ unittest$.test('dynamic dispatch', dart.fn(() => {
+ let f = dart.global.foo;
+ src__matcher__expect.expect(f.x, 3);
+ src__matcher__expect.expect(dart.fn(() => mirrors.reflect(f).setField(const$ || (const$ = dart.const(core.Symbol.new('x'))), 123), VoidToInstanceMirror()), src__matcher__throws_matcher.throws);
+ src__matcher__expect.expect(f.x, 3);
+ }, VoidTodynamic()));
+ };
+ dart.fn(mirrors_js_typed_interop_test.main, VoidTodynamic());
+ // Exports:
+ exports.mirrors_js_typed_interop_test = mirrors_js_typed_interop_test;
+});
« no previous file with comments | « test/codegen/expect/lib/html/messageevent_test.js ('k') | test/codegen/expect/lib/html/mouse_event_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698