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

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

Issue 2413073002: Start cleaning up the HTML tests. (Closed)
Patch Set: Unfork expect.dart. 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 library ElementTest;
2 import 'package:unittest/unittest.dart';
3 import 'package:unittest/html_config.dart';
4 import 'dart:html'; 1 import 'dart:html';
2
3 import 'package:minitest/minitest.dart';
4
5 import 'utils.dart'; 5 import 'utils.dart';
6 6
7 main() { 7 main() {
8 useHtmlConfiguration();
9 test('InnerHTML', () { 8 test('InnerHTML', () {
10 Element element = new Element.tag('div'); 9 Element element = new Element.tag('div');
11 element.id = 'test'; 10 element.id = 'test';
12 element.innerHtml = 'Hello World'; 11 element.innerHtml = 'Hello World';
13 document.body.append(element); 12 document.body.append(element);
14 13
15 element = document.query('#test'); 14 element = document.query('#test');
16 expect(element.innerHtml, 'Hello World'); 15 expect(element.innerHtml, 'Hello World');
17 element.remove(); 16 element.remove();
18 }); 17 });
19 test('HTMLTable', () { 18 test('HTMLTable', () {
20 Element table = new Element.tag('table'); 19 TableElement table = new Element.tag('table');
21 20
22 TableRowElement row = new Element.tag('tr'); 21 TableRowElement row = new Element.tag('tr');
23 table.append(row); 22 table.append(row);
24 23
25 row.append(new Element.tag('td')); 24 row.append(new Element.tag('td'));
26 row.append(new Element.tag('td')); 25 row.append(new Element.tag('td'));
27 26
28 expect(row.cells.length, 2); 27 expect(row.cells.length, 2);
29 28
30 TableRowElement headerRow = table.rows[0]; 29 TableRowElement headerRow = table.rows[0];
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 '<div id="dataDiv" data-my-message="Hello World"></div>', 92 '<div id="dataDiv" data-my-message="Hello World"></div>',
94 treeSanitizer: new NullTreeSanitizer()); 93 treeSanitizer: new NullTreeSanitizer());
95 expect(otherDiv.dataset.containsKey('myMessage'), isTrue); 94 expect(otherDiv.dataset.containsKey('myMessage'), isTrue);
96 95
97 Element anotherDiv = new Element.html( 96 Element anotherDiv = new Element.html(
98 '<div id="dataDiv" data-eggs="bacon"></div>', 97 '<div id="dataDiv" data-eggs="bacon"></div>',
99 treeSanitizer: new NullTreeSanitizer()); 98 treeSanitizer: new NullTreeSanitizer());
100 expect(anotherDiv.dataset.containsKey('eggs'), isTrue); 99 expect(anotherDiv.dataset.containsKey('eggs'), isTrue);
101 }); 100 });
102 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698