OLD | NEW |
1 library WebDBTest; | 1 library WebDBTest; |
2 import 'dart:async'; | 2 import 'dart:async'; |
3 import 'dart:html'; | 3 import 'dart:html'; |
4 import 'dart:web_sql'; | 4 import 'dart:web_sql'; |
5 import '../../pkg/unittest/lib/unittest.dart'; | 5 import '../../pkg/unittest/lib/unittest.dart'; |
6 import '../../pkg/unittest/lib/html_individual_config.dart'; | 6 import '../../pkg/unittest/lib/html_individual_config.dart'; |
7 | 7 |
8 void fail(message) { | |
9 guardAsync(() { | |
10 expect(false, isTrue, reason: message); | |
11 }); | |
12 } | |
13 | |
14 Future<SqlTransaction> transaction(SqlDatabase db) { | 8 Future<SqlTransaction> transaction(SqlDatabase db) { |
15 final completer = new Completer<SqlTransaction>.sync(); | 9 final completer = new Completer<SqlTransaction>.sync(); |
16 | 10 |
17 db.transaction((SqlTransaction transaction) { | 11 db.transaction((SqlTransaction transaction) { |
18 completer.complete(transaction); | 12 completer.complete(transaction); |
19 }, (SqlError error) { | 13 }, (SqlError error) { |
20 completer.completeError(error); | 14 completer.completeError(error); |
21 }); | 15 }); |
22 | 16 |
23 return completer.future; | 17 return completer.future; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 var row = resultSet.rows.item(0); | 132 var row = resultSet.rows.item(0); |
139 expect(row.containsKey(columnName), isTrue); | 133 expect(row.containsKey(columnName), isTrue); |
140 expect(row[columnName], 'Some text data'); | 134 expect(row[columnName], 'Some text data'); |
141 expect(resultSet.rows[0], row); | 135 expect(resultSet.rows[0], row); |
142 }).then((_) { | 136 }).then((_) { |
143 return dropTable(tx, tableName); | 137 return dropTable(tx, tableName); |
144 }); | 138 }); |
145 }); | 139 }); |
146 }); | 140 }); |
147 } | 141 } |
OLD | NEW |