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

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

Issue 12320101: Fixing Indexed DB supported check. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 | « tests/html/html.status ('k') | tools/dom/templates/html/impl/impl_IDBFactory.darttemplate » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library IndexedDB1Test; 1 library IndexedDB1Test;
2 import '../../pkg/unittest/lib/unittest.dart'; 2 import '../../pkg/unittest/lib/unittest.dart';
3 import '../../pkg/unittest/lib/html_individual_config.dart'; 3 import '../../pkg/unittest/lib/html_individual_config.dart';
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:html' as html; 5 import 'dart:html' as html;
6 import 'dart:indexed_db' as idb; 6 import 'dart:indexed_db' as idb;
7 import 'utils.dart'; 7 import 'utils.dart';
8 8
9 main() { 9 main() {
10 useHtmlIndividualConfiguration(); 10 useHtmlIndividualConfiguration();
11 if (!idb.IdbFactory.supported) {
12 return;
13 }
14 11
15 group('supportsDatabaseNames', () { 12 group('supportsDatabaseNames', () {
16 test('supported', () { 13 test('supported', () {
17 expect(html.window.indexedDB.supportsDatabaseNames, isTrue); 14 expect(html.window.indexedDB.supportsDatabaseNames, isTrue);
18 }); 15 });
19 }); 16 });
20 17
18 if (!idb.IdbFactory.supported) {
19 return;
20 }
21
21 group('functional', () { 22 group('functional', () {
22 var dbName = 'test_db'; 23 var dbName = 'test_db';
23 var storeName = 'test_store'; 24 var storeName = 'test_store';
24 var indexName = 'name_index'; 25 var indexName = 'name_index';
25 var db; 26 var db;
26 27
27 futureTest('init', () { 28 futureTest('init', () {
28 return html.window.indexedDB.deleteDatabase(dbName).then((_) { 29 return html.window.indexedDB.deleteDatabase(dbName).then((_) {
29 return html.window.indexedDB.open(dbName, version: 1, 30 return html.window.indexedDB.open(dbName, version: 1,
30 onUpgradeNeeded: (e) { 31 onUpgradeNeeded: (e) {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 transaction = db.transaction([storeName], 'readonly'); 183 transaction = db.transaction([storeName], 'readonly');
183 var index = transaction.objectStore(storeName).index(indexName); 184 var index = transaction.objectStore(storeName).index(indexName);
184 return index.get('two'); 185 return index.get('two');
185 }).then((readValue) { 186 }).then((readValue) {
186 expect(readValue, isNull); 187 expect(readValue, isNull);
187 return transaction.completed; 188 return transaction.completed;
188 }); 189 });
189 }); 190 });
190 }); 191 });
191 } 192 }
OLDNEW
« no previous file with comments | « tests/html/html.status ('k') | tools/dom/templates/html/impl/impl_IDBFactory.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698