Title: [237694] trunk/LayoutTests
Revision
237694
Author
drou...@apple.com
Date
2018-11-01 12:12:45 -0700 (Thu, 01 Nov 2018)

Log Message

Web Inspector: fix debug WK1 test failures for WI.ObjectStore
https://bugs.webkit.org/show_bug.cgi?id=191158

Reviewed by Joseph Pecoraro.

* inspector/unit-tests/objectStore/delete.html:
* inspector/unit-tests/objectStore/deleteObject.html:
* inspector/unit-tests/objectStore/resources/objectStore-utilities.js:
(TestPage.registerInitializer):

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (237693 => 237694)


--- trunk/LayoutTests/ChangeLog	2018-11-01 18:58:31 UTC (rev 237693)
+++ trunk/LayoutTests/ChangeLog	2018-11-01 19:12:45 UTC (rev 237694)
@@ -1,3 +1,15 @@
+2018-11-01  Devin Rousso  <drou...@apple.com>
+
+        Web Inspector: fix debug WK1 test failures for WI.ObjectStore
+        https://bugs.webkit.org/show_bug.cgi?id=191158
+
+        Reviewed by Joseph Pecoraro.
+
+        * inspector/unit-tests/objectStore/delete.html:
+        * inspector/unit-tests/objectStore/deleteObject.html:
+        * inspector/unit-tests/objectStore/resources/objectStore-utilities.js:
+        (TestPage.registerInitializer):
+
 2018-11-01  Said Abou-Hallawa  <sabouhall...@apple.com>
 
         [CG] Adopt CG SPI for non-even cornered rounded rects

Modified: trunk/LayoutTests/inspector/unit-tests/objectStore/delete.html (237693 => 237694)


--- trunk/LayoutTests/inspector/unit-tests/objectStore/delete.html	2018-11-01 18:58:31 UTC (rev 237693)
+++ trunk/LayoutTests/inspector/unit-tests/objectStore/delete.html	2018-11-01 19:12:45 UTC (rev 237694)
@@ -27,7 +27,10 @@
         };
         let objectStore = InspectorTest.ObjectStore.createObjectStore(options);
 
-        await InspectorTest.ObjectStore.add(InspectorTest.ObjectStore.basicObject2, 1);
+        try {
+            // This call may fail on WK1
+            await InspectorTest.ObjectStore.add(InspectorTest.ObjectStore.basicObject2, 1);
+        } catch { }
 
         await InspectorTest.expectException(async () => {
             await objectStore.delete();

Modified: trunk/LayoutTests/inspector/unit-tests/objectStore/deleteObject.html (237693 => 237694)


--- trunk/LayoutTests/inspector/unit-tests/objectStore/deleteObject.html	2018-11-01 18:58:31 UTC (rev 237693)
+++ trunk/LayoutTests/inspector/unit-tests/objectStore/deleteObject.html	2018-11-01 19:12:45 UTC (rev 237694)
@@ -30,11 +30,16 @@
         };
         let objectStore = InspectorTest.ObjectStore.createObjectStore(options);
 
-        await InspectorTest.ObjectStore.add(new InspectorTest.ObjectStore.TestObject(InspectorTest.ObjectStore.basicObject2), 1);
+        let object = new InspectorTest.ObjectStore.TestObject(InspectorTest.ObjectStore.basicObject2);
 
+        try {
+            // This call may fail on WK1
+            await InspectorTest.ObjectStore.add(object, 1);
+        } catch { }
+
         await InspectorTest.expectException(async () => {
             await objectStore.deleteObject();
-            await objectStore.deleteObject(new InspectorTest.ObjectStore.TestObject(InspectorTest.ObjectStore.basicObject2));
+            await objectStore.deleteObject(object);
         });
     });
 

Modified: trunk/LayoutTests/inspector/unit-tests/objectStore/resources/objectStore-utilities.js (237693 => 237694)


--- trunk/LayoutTests/inspector/unit-tests/objectStore/resources/objectStore-utilities.js	2018-11-01 18:58:31 UTC (rev 237693)
+++ trunk/LayoutTests/inspector/unit-tests/objectStore/resources/objectStore-utilities.js	2018-11-01 19:12:45 UTC (rev 237694)
@@ -86,7 +86,11 @@
                     WI.ObjectStore._database = null;
                 }
 
-                indexedDB.deleteDatabase(WI.ObjectStore._databaseName);
+                await new Promise((resolve, reject) => {
+                    let deleteDatabaseRequest = indexedDB.deleteDatabase(WI.ObjectStore._databaseName);
+                    deleteDatabaseRequest.addEventListener("success", resolve);
+                    deleteDatabaseRequest.addEventListener("error", reject);
+                });
             },
         });
     };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to