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

Unified Diff: tests/html/table_test.dart

Issue 12320102: Cleaning up the TableElement API (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
Index: tests/html/table_test.dart
diff --git a/tests/html/table_test.dart b/tests/html/table_test.dart
index fda9fcccef14b14195eb34498d9fb73e14b571f7..5c1144f5d2e266cad0d0eb0a4e2e5401cc51dfd3 100644
--- a/tests/html/table_test.dart
+++ b/tests/html/table_test.dart
@@ -13,31 +13,49 @@ main() {
test('createTBody', () {
var table = new TableElement();
var head = table.createTHead();
- var headerRow = head.insertRow(-1);
- var headerCell = headerRow.insertCell(-1);
+ expect(table.tHead, head);
+
+ var headerRow = head.addRow();
+ var headerCell = headerRow.addCell();
headerCell.text = 'Header Cell';
- var body = table.createTBody();
- var bodyRow = body.insertRow(-1);
- var bodyCell = bodyRow.insertCell(-1);
- bodyCell.text = 'Body Cell';
+ var caption = table.createCaption();
+ expect(table.caption, caption);
+ var body = table.createTBody();
expect(table.tBodies.length, 1);
expect(table.tBodies[0], body);
+ var bodyRow = body.addRow();
+ expect(body.rows.length, 1);
+ expect(body.rows[0], bodyRow);
+
+ var bodyCell = bodyRow.addCell();
+ bodyCell.text = 'Body Cell';
+ expect(bodyRow.cells.length, 1);
+ expect(bodyRow.cells[0], bodyCell);
+
var foot = table.createTFoot();
- var footerRow = foot.insertRow(-1);
- var footerCell = footerRow.insertCell(-1);
+ expect(table.tFoot, foot);
+
+ var footerRow = foot.addRow();
+ expect(foot.rows.length, 1);
+ expect(foot.rows[0], footerRow);
+
+ var footerCell = footerRow.addCell();
footerCell.text = 'Footer Cell';
+ expect(footerRow.cells.length, 1);
+ expect(footerRow.cells[0], footerCell);
var body2 = table.createTBody();
- var bodyRow2 = body2.insertRow(-1);
- var bodyCell2 = bodyRow2.insertCell(-1);
+ var bodyRow2 = body2.addRow();
+ var bodyCell2 = bodyRow2.addCell();
bodyCell2.text = 'Body Cell2';
+ expect(body2.rows.length, 1);
+
expect(table.tBodies.length, 2);
expect(table.tBodies[1], body2);
-
});
}

Powered by Google App Engine
This is Rietveld 408576698