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

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

Issue 10917275: Update unittest to new package layout. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 3 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/indexeddb_2_test.dart ('k') | tests/html/indexeddb_4_test.dart » ('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('IndexedDB3Test'); 1 #library('IndexedDB3Test');
2 #import('../../pkg/unittest/unittest.dart'); 2 #import('../../pkg/unittest/lib/unittest.dart');
3 #import('../../pkg/unittest/html_config.dart'); 3 #import('../../pkg/unittest/lib/html_config.dart');
4 #import('dart:html'); 4 #import('dart:html');
5 5
6 // Read with cursor. 6 // Read with cursor.
7 7
8 const String DB_NAME = 'Test'; 8 const String DB_NAME = 'Test';
9 const String STORE_NAME = 'TEST'; 9 const String STORE_NAME = 'TEST';
10 const String VERSION = '1'; 10 const String VERSION = '1';
11 11
12 class Test { 12 class Test {
13 var db; 13 var db;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 request.on.success.add(expectAsync1((e) { 49 request.on.success.add(expectAsync1((e) {
50 writeItems(index + 1); 50 writeItems(index + 1);
51 } 51 }
52 )); 52 ));
53 request.on.error.add(fail('put')); 53 request.on.error.add(fail('put'));
54 } 54 }
55 } 55 }
56 56
57 fail(message) => (e) { 57 fail(message) => (e) {
58 guardAsync(() { 58 guardAsync(() {
59 Expect.fail('IndexedDB failure: $message'); 59 Expect.fail('IndexedDB failure: $message');
60 }); 60 });
61 }; 61 };
62 62
63 readAllViaCursor() { 63 readAllViaCursor() {
64 IDBTransaction txn = db.transaction(STORE_NAME, 'readonly'); 64 IDBTransaction txn = db.transaction(STORE_NAME, 'readonly');
65 IDBObjectStore objectStore = txn.objectStore(STORE_NAME); 65 IDBObjectStore objectStore = txn.objectStore(STORE_NAME);
66 IDBRequest cursorRequest = objectStore.openCursor(); 66 IDBRequest cursorRequest = objectStore.openCursor();
67 int itemCount = 0; 67 int itemCount = 0;
68 int sumKeys = 0; 68 int sumKeys = 0;
69 int lastKey = null; 69 int lastKey = null;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 main() { 115 main() {
116 useHtmlConfiguration(); 116 useHtmlConfiguration();
117 117
118 var test_ = new Test(); 118 var test_ = new Test();
119 test('prepare', test_.start); 119 test('prepare', test_.start);
120 test('readAll1', test_.readAllViaCursor); 120 test('readAll1', test_.readAllViaCursor);
121 test('readAll2', test_.readAllReversedViaCursor); 121 test('readAll2', test_.readAllReversedViaCursor);
122 } 122 }
OLDNEW
« no previous file with comments | « tests/html/indexeddb_2_test.dart ('k') | tests/html/indexeddb_4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698