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

Unified Diff: tests/lib_strong/html/indexeddb_4_test.dart

Issue 2771453003: Format all tests. (Closed)
Patch Set: Format files Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: tests/lib_strong/html/indexeddb_4_test.dart
diff --git a/tests/lib_strong/html/indexeddb_4_test.dart b/tests/lib_strong/html/indexeddb_4_test.dart
index 37613015b2c0c71c2b1f1cb77fa9af5e956b60c1..45bd313bec677a62acbfff078af644a0b1381dc6 100644
--- a/tests/lib_strong/html/indexeddb_4_test.dart
+++ b/tests/lib_strong/html/indexeddb_4_test.dart
@@ -1,4 +1,5 @@
library IndexedDB4Test;
+
import 'package:unittest/unittest.dart';
import 'package:unittest/html_config.dart';
import 'dart:async';
@@ -15,17 +16,18 @@ Future<Database> createAndOpenDb() {
return html.window.indexedDB.deleteDatabase(DB_NAME).then((_) {
return html.window.indexedDB.open(DB_NAME, version: VERSION,
onUpgradeNeeded: (e) {
- var db = e.target.result;
- db.createObjectStore(STORE_NAME);
- });
+ var db = e.target.result;
+ db.createObjectStore(STORE_NAME);
+ });
});
}
Future<Database> writeItems(Database db) {
Future<Object> write(index) {
var transaction = db.transaction(STORE_NAME, 'readwrite');
- return transaction.objectStore(STORE_NAME).put(
- {'content': 'Item $index'}, index);
+ return transaction
+ .objectStore(STORE_NAME)
+ .put({'content': 'Item $index'}, index);
}
var future = write(0);
@@ -44,7 +46,8 @@ Future<Database> setupDb() {
testRange(db, range, expectedFirst, expectedLast) {
Transaction txn = db.transaction(STORE_NAME, 'readonly');
ObjectStore objectStore = txn.objectStore(STORE_NAME);
- var cursors = objectStore.openCursor(range: range, autoAdvance: true)
+ var cursors = objectStore
+ .openCursor(range: range, autoAdvance: true)
.asBroadcastStream();
int lastKey;
@@ -84,37 +87,33 @@ main() {
setUp(() {
if (db == null) {
return setupDb().then((result) {
- db = result;
- });
+ db = result;
+ });
}
});
test('only1', () => testRange(db, new KeyRange.only(55), 55, 55));
test('only2', () => testRange(db, new KeyRange.only(100), null, null));
test('only3', () => testRange(db, new KeyRange.only(-1), null, null));
- test('lower1', () =>
- testRange(db, new KeyRange.lowerBound(40), 40, 99));
+ test('lower1', () => testRange(db, new KeyRange.lowerBound(40), 40, 99));
// OPTIONALS lower2() => testRange(db, new KeyRange.lowerBound(40, open: true), 41, 99);
- test('lower2', () =>
- testRange(db, new KeyRange.lowerBound(40, true), 41, 99));
+ test('lower2',
+ () => testRange(db, new KeyRange.lowerBound(40, true), 41, 99));
// OPTIONALS lower3() => testRange(db, new KeyRange.lowerBound(40, open: false), 40, 99);
- test('lower3', () =>
- testRange(db, new KeyRange.lowerBound(40, false), 40, 99));
+ test('lower3',
+ () => testRange(db, new KeyRange.lowerBound(40, false), 40, 99));
- test('upper1', () =>
- testRange(db, new KeyRange.upperBound(40), 0, 40));
+ test('upper1', () => testRange(db, new KeyRange.upperBound(40), 0, 40));
// OPTIONALS upper2() => testRange(db, new KeyRange.upperBound(40, open: true), 0, 39);
- test('upper2', () =>
- testRange(db, new KeyRange.upperBound(40, true), 0, 39));
+ test('upper2',
+ () => testRange(db, new KeyRange.upperBound(40, true), 0, 39));
// upper3() => testRange(db, new KeyRange.upperBound(40, open: false), 0, 40);
- test('upper3', () =>
- testRange(db, new KeyRange.upperBound(40, false), 0, 40));
+ test('upper3',
+ () => testRange(db, new KeyRange.upperBound(40, false), 0, 40));
- test('bound1', () =>
- testRange(db, new KeyRange.bound(20, 30), 20, 30));
+ test('bound1', () => testRange(db, new KeyRange.bound(20, 30), 20, 30));
- test('bound2', () =>
- testRange(db, new KeyRange.bound(-100, 200), 0, 99));
+ test('bound2', () => testRange(db, new KeyRange.bound(-100, 200), 0, 99));
bound3() =>
// OPTIONALS testRange(db, new KeyRange.bound(20, 30, upperOpen: true),

Powered by Google App Engine
This is Rietveld 408576698