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

Side by Side Diff: tests/lib_strong/html/hidden_dom_1_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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:expect/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(() {
18 confuse(e).onfocus = null;
19 }, throwsNoSuchMethodError);
18 }); 20 });
19
20 } 21 }
21 22
22 class Decoy { 23 class Decoy {
23 void set onfocus(x) { throw 'dead code'; } 24 void set onfocus(x) {
25 throw 'dead code';
26 }
24 } 27 }
25 28
26 confuse(x) => opaqueTrue() ? x : (opaqueTrue() ? new Object() : new Decoy()); 29 confuse(x) => opaqueTrue() ? x : (opaqueTrue() ? new Object() : new Decoy());
27 30
28 /** Returns `true`, but in a way that confuses the compiler. */ 31 /** Returns `true`, but in a way that confuses the compiler. */
29 opaqueTrue() => true; // Expand as needed. 32 opaqueTrue() => true; // Expand as needed.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698