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

Side by Side Diff: tests/html/websql_test.dart

Issue 12334094: Fixing WebSQL test for case where it's not supported. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import 'utils.dart'; 7 import 'utils.dart';
8 8
9 void fail(message) { 9 void fail(message) {
10 guardAsync(() { 10 guardAsync(() {
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 test('unsupported throws', () { 104 test('unsupported throws', () {
105 var expectation = SqlDatabase.supported ? returnsNormally : throws; 105 var expectation = SqlDatabase.supported ? returnsNormally : throws;
106 expect(() { 106 expect(() {
107 window.openDatabase('test_db', '1.0', 'test_db', 1024 * 1024); 107 window.openDatabase('test_db', '1.0', 'test_db', 1024 * 1024);
108 }, expectation); 108 }, expectation);
109 109
110 }); 110 });
111 futureTest('Web Database', () { 111 futureTest('Web Database', () {
112 // Skip if not supported. 112 // Skip if not supported.
113 if (!SqlDatabase.supported) { 113 if (!SqlDatabase.supported) {
114 return; 114 return new Future.immediate(null);
115 } 115 }
116 116
117 final tableName = 'test_table'; 117 final tableName = 'test_table';
118 final columnName = 'test_data'; 118 final columnName = 'test_data';
119 119
120 final db = window.openDatabase('test_db', '1.0', 'test_db', 1024 * 1024); 120 final db = window.openDatabase('test_db', '1.0', 'test_db', 1024 * 1024);
121 121
122 expect(db, isNotNull, reason: 'Unable to open database'); 122 expect(db, isNotNull, reason: 'Unable to open database');
123 123
124 var tx; 124 var tx;
(...skipping 14 matching lines...) Expand all
139 var row = resultSet.rows.item(0); 139 var row = resultSet.rows.item(0);
140 expect(row.containsKey(columnName), isTrue); 140 expect(row.containsKey(columnName), isTrue);
141 expect(row[columnName], 'Some text data'); 141 expect(row[columnName], 'Some text data');
142 expect(resultSet.rows[0], row); 142 expect(resultSet.rows[0], row);
143 }).then((_) { 143 }).then((_) {
144 return dropTable(tx, tableName); 144 return dropTable(tx, tableName);
145 }); 145 });
146 }); 146 });
147 }); 147 });
148 } 148 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698