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

Side by Side Diff: pkg/dev_compiler/test/codegen/lib/html/hidden_dom_1_test.dart

Issue 2416853003: Move minitest.dart into the expect package. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 import 'dart:html'; 1 import 'dart:html';
2 2
3 import 'package:minitest/minitest.dart'; 3 import 'package:expect/minitest.dart';
4 4
5 // Test that the dart:html API does not leak native jsdom methods: 5 // Test that the dart:html API does not leak native jsdom methods:
6 // onfocus setter. 6 // onfocus setter.
7 7
8 main() { 8 main() {
9 test('test1', () { 9 test('test1', () {
10 document.body.children.add(new Element.html(r''' 10 document.body.children.add(new Element.html(r'''
11 <div id='div1'> 11 <div id='div1'>
12 Hello World! 12 Hello World!
13 </div>''')); 13 </div>'''));
14 Element e = document.query('#div1'); 14 Element e = document.query('#div1');
15 expect(e, isNotNull); 15 expect(e, isNotNull);
16 16
17 expect(() { confuse(e).onfocus = null; }, throwsNoSuchMethodError); 17 expect(() { confuse(e).onfocus = null; }, throwsNoSuchMethodError);
18 }); 18 });
19 19
20 } 20 }
21 21
22 class Decoy { 22 class Decoy {
23 void set onfocus(x) { throw 'dead code'; } 23 void set onfocus(x) { throw 'dead code'; }
24 } 24 }
25 25
26 confuse(x) => opaqueTrue() ? x : (opaqueTrue() ? new Object() : new Decoy()); 26 confuse(x) => opaqueTrue() ? x : (opaqueTrue() ? new Object() : new Decoy());
27 27
28 /** Returns `true`, but in a way that confuses the compiler. */ 28 /** Returns `true`, but in a way that confuses the compiler. */
29 opaqueTrue() => true; // Expand as needed. 29 opaqueTrue() => true; // Expand as needed.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698