| Index: tests/html/websql_test.dart
|
| diff --git a/tests/html/websql_test.dart b/tests/html/websql_test.dart
|
| index 338c618a9e026b7f3d9e6d9ec036e90af9db0698..16871b8f63437fbcd2b99cb65366dccdf8d684cb 100644
|
| --- a/tests/html/websql_test.dart
|
| +++ b/tests/html/websql_test.dart
|
| @@ -1,6 +1,6 @@
|
| library WebDBTest;
|
| import '../../pkg/unittest/lib/unittest.dart';
|
| -import '../../pkg/unittest/lib/html_config.dart';
|
| +import '../../pkg/unittest/lib/html_individual_config.dart';
|
| import 'dart:async';
|
| import 'dart:html';
|
|
|
| @@ -87,31 +87,51 @@ dropTable(tableName, [bool ignoreFailure = false]) =>
|
| };
|
|
|
| main() {
|
| - useHtmlConfiguration();
|
| -
|
| - test('Web Database', () {
|
| - final tableName = 'test_table';
|
| - final columnName = 'test_data';
|
| -
|
| - final db = window.openDatabase('test_db', '1.0', 'test_db', 1024 * 1024);
|
| -
|
| - expect(db, isNotNull, reason: 'Unable to open database');
|
| -
|
| - createTransaction(db)
|
| - // Attempt to clear out any tables which may be lurking from previous
|
| - // runs.
|
| - .then(dropTable(tableName, true))
|
| - .then(createTable(tableName, columnName))
|
| - .then(insert(tableName, columnName, 'Some text data'))
|
| - .then(queryTable(tableName, (resultSet) {
|
| - guardAsync(() {
|
| - expect(resultSet.rows.length, 1);
|
| - var row = resultSet.rows.item(0);
|
| - expect(row.containsKey(columnName), isTrue);
|
| - expect(row[columnName], 'Some text data');
|
| - });
|
| - }))
|
| - .then(dropTable(tableName))
|
| - .then(expectAsync1((tx) {}));
|
| + useHtmlIndividualConfiguration();
|
| +
|
| + group('supported', () {
|
| + test('supported', () {
|
| + expect(Database.supported, true);
|
| + });
|
| + });
|
| +
|
| + group('functional', () {
|
| + test('unsupported throws', () {
|
| + var expectation = Database.supported ? returnsNormally : throws;
|
| + expect(() {
|
| + window.openDatabase('test_db', '1.0', 'test_db', 1024 * 1024);
|
| + }, expectation);
|
| +
|
| + });
|
| + test('Web Database', () {
|
| + // Skip if not supported.
|
| + if (!Database.supported) {
|
| + return;
|
| + }
|
| +
|
| + final tableName = 'test_table';
|
| + final columnName = 'test_data';
|
| +
|
| + final db = window.openDatabase('test_db', '1.0', 'test_db', 1024 * 1024);
|
| +
|
| + expect(db, isNotNull, reason: 'Unable to open database');
|
| +
|
| + createTransaction(db)
|
| + // Attempt to clear out any tables which may be lurking from previous
|
| + // runs.
|
| + .then(dropTable(tableName, true))
|
| + .then(createTable(tableName, columnName))
|
| + .then(insert(tableName, columnName, 'Some text data'))
|
| + .then(queryTable(tableName, (resultSet) {
|
| + guardAsync(() {
|
| + expect(resultSet.rows.length, 1);
|
| + var row = resultSet.rows.item(0);
|
| + expect(row.containsKey(columnName), isTrue);
|
| + expect(row[columnName], 'Some text data');
|
| + });
|
| + }))
|
| + .then(dropTable(tableName))
|
| + .then(expectAsync1((tx) {}));
|
| + });
|
| });
|
| }
|
|
|