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

Unified Diff: test/codegen/expect/lib/html/cross_domain_iframe_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/client_rect_test.js ('k') | test/codegen/expect/lib/html/cross_frame_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/cross_domain_iframe_test.js
diff --git a/test/codegen/expect/lib/html/cross_domain_iframe_test.js b/test/codegen/expect/lib/html/cross_domain_iframe_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..012c9f1750af7bd4f0b6023d491e06ba40ae1979
--- /dev/null
+++ b/test/codegen/expect/lib/html/cross_domain_iframe_test.js
@@ -0,0 +1,36 @@
+dart_library.library('lib/html/cross_domain_iframe_test', null, /* Imports */[
+ 'dart_sdk',
+ 'unittest'
+], function load__cross_domain_iframe_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 unittest$ = unittest.unittest;
+ const src__matcher__expect = unittest.src__matcher__expect;
+ const src__matcher__core_matchers = unittest.src__matcher__core_matchers;
+ const cross_domain_iframe_test = Object.create(null);
+ let MessageEventTodynamic = () => (MessageEventTodynamic = dart.constFn(dart.functionType(dart.dynamic, [html.MessageEvent])))();
+ let MessageEventTodynamic$ = () => (MessageEventTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [html.MessageEvent])))();
+ let MessageEventTobool = () => (MessageEventTobool = dart.constFn(dart.definiteFunctionType(core.bool, [html.MessageEvent])))();
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ cross_domain_iframe_test.main = function() {
+ unittest$.test('cross_domain_iframe', dart.fn(() => {
+ let uri = core.Uri.parse(html.window[dartx.location][dartx.href]);
+ let crossOriginPort = core.int.parse(uri.queryParameters[dartx.get]('crossOriginPort'));
+ let crossOrigin = dart.str`${uri.scheme}://${uri.host}:${crossOriginPort}`;
+ let crossOriginUrl = dart.str`${crossOrigin}/root_dart/tests/html/cross_domain_iframe_script.html`;
+ let iframe = html.IFrameElement.new();
+ iframe[dartx.src] = crossOriginUrl;
+ html.document[dartx.body][dartx.append](iframe);
+ html.window[dartx.onMessage].where(dart.fn(event => event[dartx.origin] == crossOrigin, MessageEventTobool())).first.then(dart.dynamic)(MessageEventTodynamic()._check(unittest$.expectAsync(dart.fn(event => {
+ src__matcher__expect.expect(event[dartx.data], src__matcher__core_matchers.equals('foobar'));
+ src__matcher__expect.expect(event[dartx.source], src__matcher__core_matchers.isNotNull);
+ }, MessageEventTodynamic$()))));
+ }, VoidTodynamic()));
+ };
+ dart.fn(cross_domain_iframe_test.main, VoidTodynamic());
+ // Exports:
+ exports.cross_domain_iframe_test = cross_domain_iframe_test;
+});
« no previous file with comments | « test/codegen/expect/lib/html/client_rect_test.js ('k') | test/codegen/expect/lib/html/cross_frame_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698