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

Unified Diff: tests/html/indexeddb_1_test.dart

Issue 12723012: Attempting to fix indexed_db IE10 test timeouts. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/html/html.status ('k') | tests/html/indexeddb_2_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/indexeddb_1_test.dart
diff --git a/tests/html/indexeddb_1_test.dart b/tests/html/indexeddb_1_test.dart
index 3505c2e883fe4a6fed0fda16d41f16e12489ab2f..7fb41fb0c7094fd51b72ceee34c04e81d1afc069 100644
--- a/tests/html/indexeddb_1_test.dart
+++ b/tests/html/indexeddb_1_test.dart
@@ -5,12 +5,16 @@ import 'dart:async';
import 'dart:html' as html;
import 'dart:indexed_db' as idb;
-const String DB_NAME = 'Test';
const String STORE_NAME = 'TEST';
const int VERSION = 1;
+var databaseNameIndex = 0;
+String nextDatabaseName() {
+ return 'Test1_${databaseNameIndex++}';
+}
+
Future testUpgrade() {
- var dbName = 'version_db';
+ var dbName = nextDatabaseName();
var upgraded = false;
// Delete any existing DBs.
@@ -34,7 +38,10 @@ Future testUpgrade() {
}
testReadWrite(key, value, matcher,
- [dbName = DB_NAME, storeName = STORE_NAME, version = VERSION]) => () {
+ [dbName, storeName = STORE_NAME, version = VERSION]) => () {
+ if (dbName == null) {
+ dbName = nextDatabaseName();
+ }
createObjectStore(e) {
var store = e.target.result.createObjectStore(storeName);
expect(store, isNotNull);
@@ -59,11 +66,15 @@ testReadWrite(key, value, matcher,
if (db != null) {
db.close();
}
+ return html.window.indexedDB.deleteDatabase(dbName);
});
};
testReadWriteTyped(key, value, matcher,
- [dbName = DB_NAME, storeName = STORE_NAME, version = VERSION]) => () {
+ [dbName, storeName = STORE_NAME, version = VERSION]) => () {
+ if (dbName == null) {
+ dbName = nextDatabaseName();
+ }
void createObjectStore(e) {
var store = e.target.result.createObjectStore(storeName);
expect(store, isNotNull);
@@ -90,6 +101,7 @@ testReadWriteTyped(key, value, matcher,
if (db != null) {
db.close();
}
+ return html.window.indexedDB.deleteDatabase(dbName);
});
};
« no previous file with comments | « tests/html/html.status ('k') | tests/html/indexeddb_2_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698