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

Unified Diff: test/codegen/expect/lib/html/hidden_dom_2_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/hidden_dom_1_test.js ('k') | test/codegen/expect/lib/html/history_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/hidden_dom_2_test.js
diff --git a/test/codegen/expect/lib/html/hidden_dom_2_test.js b/test/codegen/expect/lib/html/hidden_dom_2_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..e23c51e11b11acb0f2ca1fc40dc6bde4fb427340
--- /dev/null
+++ b/test/codegen/expect/lib/html/hidden_dom_2_test.js
@@ -0,0 +1,65 @@
+dart_library.library('lib/html/hidden_dom_2_test', null, /* Imports */[
+ 'dart_sdk',
+ 'unittest'
+], function load__hidden_dom_2_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 src__matcher__expect = unittest.src__matcher__expect;
+ const src__matcher__core_matchers = unittest.src__matcher__core_matchers;
+ const src__matcher__error_matchers = unittest.src__matcher__error_matchers;
+ const hidden_dom_2_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.functionType(dart.dynamic, [])))();
+ let VoidTodynamic$ = () => (VoidTodynamic$ = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic])))();
+ let FnTodynamic = () => (FnTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [VoidTodynamic()])))();
+ hidden_dom_2_test.main = function() {
+ html_config.useHtmlConfiguration();
+ unittest$.test('test1', dart.fn(() => {
+ html.document[dartx.body][dartx.children][dartx.add](html.Element.html('<div id=\'div1\'>\nHello World!\n</div>'));
+ let e = html.document[dartx.query]('#div1');
+ let e2 = html.Element.html("<div id='xx'>XX</div>");
+ src__matcher__expect.expect(e, src__matcher__core_matchers.isNotNull);
+ hidden_dom_2_test.checkNoSuchMethod(dart.fn(() => {
+ dart.dsend(hidden_dom_2_test.confuse(e), 'appendChild', e2);
+ }, VoidTodynamic$()));
+ }, VoidTodynamic$()));
+ };
+ dart.fn(hidden_dom_2_test.main, VoidTodynamic$());
+ hidden_dom_2_test.Decoy = class Decoy extends core.Object {
+ appendChild(x) {
+ dart.throw('dead code');
+ }
+ };
+ dart.setSignature(hidden_dom_2_test.Decoy, {
+ methods: () => ({appendChild: dart.definiteFunctionType(dart.void, [dart.dynamic])})
+ });
+ hidden_dom_2_test.confuse = function(x) {
+ return dart.test(hidden_dom_2_test.opaqueTrue()) ? x : dart.test(hidden_dom_2_test.opaqueTrue()) ? new core.Object() : new hidden_dom_2_test.Decoy();
+ };
+ dart.fn(hidden_dom_2_test.confuse, dynamicTodynamic());
+ hidden_dom_2_test.opaqueTrue = function() {
+ return true;
+ };
+ dart.fn(hidden_dom_2_test.opaqueTrue, VoidTodynamic$());
+ hidden_dom_2_test.checkNoSuchMethod = function(action) {
+ let ex = null;
+ let threw = false;
+ try {
+ action();
+ } catch (e) {
+ threw = true;
+ ex = e;
+ }
+
+ if (!threw) src__matcher__expect.expect(false, src__matcher__core_matchers.isTrue, {reason: 'Action should have thrown exception'});
+ src__matcher__expect.expect(ex, src__matcher__error_matchers.isNoSuchMethodError);
+ };
+ dart.fn(hidden_dom_2_test.checkNoSuchMethod, FnTodynamic());
+ // Exports:
+ exports.hidden_dom_2_test = hidden_dom_2_test;
+});
« no previous file with comments | « test/codegen/expect/lib/html/hidden_dom_1_test.js ('k') | test/codegen/expect/lib/html/history_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698