| OLD | NEW |
| 1 #library('WebDBTest'); | 1 #library('WebDBTest'); |
| 2 #import('../../pkg/unittest/unittest.dart'); | 2 #import('../../pkg/unittest/unittest.dart'); |
| 3 #import('../../pkg/unittest/html_config.dart'); | 3 #import('../../pkg/unittest/html_config.dart'); |
| 4 #import('dart:html'); | 4 #import('dart:html'); |
| 5 | 5 |
| 6 void fail(message) { | 6 void fail(message) { |
| 7 guardAsync(() { | 7 guardAsync(() { |
| 8 Expect.fail(message); | 8 Expect.fail(message); |
| 9 }); | 9 }); |
| 10 } | 10 } |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 98 |
| 99 createTransaction(db) | 99 createTransaction(db) |
| 100 // Attempt to clear out any tables which may be lurking from previous | 100 // Attempt to clear out any tables which may be lurking from previous |
| 101 // runs. | 101 // runs. |
| 102 .chain(dropTable(tableName, true)) | 102 .chain(dropTable(tableName, true)) |
| 103 .chain(createTable(tableName, columnName)) | 103 .chain(createTable(tableName, columnName)) |
| 104 .chain(insert(tableName, columnName, 'Some text data')) | 104 .chain(insert(tableName, columnName, 'Some text data')) |
| 105 .chain(queryTable(tableName, (resultSet) { | 105 .chain(queryTable(tableName, (resultSet) { |
| 106 guardAsync(() { | 106 guardAsync(() { |
| 107 Expect.equals(1, resultSet.rows.length); | 107 Expect.equals(1, resultSet.rows.length); |
| 108 | 108 var row = resultSet.rows.item(0); |
| 109 // Should validate the rowData contents- need to be able to map the JS | 109 Expect.isTrue(row.containsKey(columnName)); |
| 110 // object back to regular types. | 110 Expect.equals('Some text data', row[columnName]); |
| 111 }); | 111 }); |
| 112 })) | 112 })) |
| 113 .chain(dropTable(tableName)) | 113 .chain(dropTable(tableName)) |
| 114 .then(expectAsync1((tx) {})); | 114 .then(expectAsync1((tx) {})); |
| 115 }); | 115 }); |
| 116 } | 116 } |
| OLD | NEW |