Web Inspector: Reduce flakiness of inspector/indexeddb/requestDatabaseNames
authorjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Aug 2015 01:29:48 +0000 (01:29 +0000)
committerjoepeck@webkit.org <joepeck@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Aug 2015 01:29:48 +0000 (01:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=148008

Reviewed by Timothy Hatcher.

* inspector/indexeddb/requestDatabaseNames.html:
Follow-up fix to reduce flakiness in the test caused by other tests
creating IndexedDB databases.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@188426 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/inspector/indexeddb/requestDatabaseNames.html

index ab11bac..a90b8f3 100644 (file)
@@ -1,3 +1,14 @@
+2015-08-13  Joseph Pecoraro  <pecoraro@apple.com>
+
+        Web Inspector: Reduce flakiness of inspector/indexeddb/requestDatabaseNames
+        https://bugs.webkit.org/show_bug.cgi?id=148008
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/indexeddb/requestDatabaseNames.html:
+        Follow-up fix to reduce flakiness in the test caused by other tests
+        creating IndexedDB databases.
+
 2015-08-13  Jon Honeycutt  <jhoneycutt@apple.com>
 
         iOS test gardening.
index 5a03211..17afe4a 100644 (file)
@@ -11,11 +11,27 @@ function createDatabase(name)
     });
 }
 
+function deleteDatabaseNames(names)
+{
+    for (let name of names)
+        window.indexedDB.deleteDatabase(name);
+}
+
 function test()
 {
     var steps = [
         {
             action: function() {
+                // FIXME: Remove any existing IndexedDB databases that might exist to workaround:
+                // <https://webkit.org/b/148006> Each test should run with its own clean data store
+                IndexedDBAgent.requestDatabaseNames(WebInspector.frameResourceManager.mainFrame.securityOrigin, function(error, names) {
+                    InspectorTest.evaluateInPage("deleteDatabaseNames(" + JSON.stringify(names) + ")");
+                    next();
+                });
+            }
+        },
+        {
+            action: function() {
                 IndexedDBAgent.requestDatabaseNames(WebInspector.frameResourceManager.mainFrame.securityOrigin, function(error, names) {
                     InspectorTest.expectNoError(error);
                     InspectorTest.expectThat(names.length === 0, "No IndexedDB databases should exist initially");