Title: [196137] trunk
Revision
196137
Author
[email protected]
Date
2016-02-04 11:46:47 -0800 (Thu, 04 Feb 2016)

Log Message

Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=153438.

Reviewed by Alex Christensen.

Source/WebCore:

Tests: storage/indexeddb/modern/idbkey-array-equality-private.html
       storage/indexeddb/modern/idbkey-array-equality.html

* Modules/indexeddb/IDBKeyData.cpp:
(WebCore::IDBKeyData::loggingString):
(WebCore::IDBKeyData::operator==): Fix obvious bug.

LayoutTests:

* platform/mac-wk1/TestExpectations: Re-enable the flaky test.
* resources/js-test.js:
* storage/indexeddb/modern/idbkey-array-equality-expected.txt: Added.
* storage/indexeddb/modern/idbkey-array-equality-private-expected.txt: Added.
* storage/indexeddb/modern/idbkey-array-equality-private.html: Added.
* storage/indexeddb/modern/idbkey-array-equality.html: Added.
* storage/indexeddb/modern/resources/idbkey-array-equality.js: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (196136 => 196137)


--- trunk/LayoutTests/ChangeLog	2016-02-04 19:38:12 UTC (rev 196136)
+++ trunk/LayoutTests/ChangeLog	2016-02-04 19:46:47 UTC (rev 196137)
@@ -1,3 +1,18 @@
+2016-02-04  Brady Eidson  <[email protected]>
+
+        Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
+        https://bugs.webkit.org/show_bug.cgi?id=153438.
+
+        Reviewed by Alex Christensen.
+
+        * platform/mac-wk1/TestExpectations: Re-enable the flaky test.
+        * resources/js-test.js:
+        * storage/indexeddb/modern/idbkey-array-equality-expected.txt: Added.
+        * storage/indexeddb/modern/idbkey-array-equality-private-expected.txt: Added.
+        * storage/indexeddb/modern/idbkey-array-equality-private.html: Added.
+        * storage/indexeddb/modern/idbkey-array-equality.html: Added.
+        * storage/indexeddb/modern/resources/idbkey-array-equality.js: Added.
+
 2016-02-04  Ryan Haddad  <[email protected]>
 
         Skip two flaky indexeddb tests on Yosemite Release WK2

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (196136 => 196137)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-02-04 19:38:12 UTC (rev 196136)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2016-02-04 19:46:47 UTC (rev 196137)
@@ -64,8 +64,6 @@
 
 webkit.org/b/153460 [ Debug ] inspector/codemirror/prettyprinting-css-rules.html [ Pass Timeout ]
 
-webkit.org/b/153438 imported/w3c/indexeddb/keyorder-private.html [ Pass Failure ]
-
 ### END OF (1) Failures with bug reports
 ########################################
 

Modified: trunk/LayoutTests/resources/js-test.js (196136 => 196137)


--- trunk/LayoutTests/resources/js-test.js	2016-02-04 19:38:12 UTC (rev 196136)
+++ trunk/LayoutTests/resources/js-test.js	2016-02-04 19:46:47 UTC (rev 196137)
@@ -6,7 +6,7 @@
         testRunner.dumpAsText();
 
     // If the test file URL ends in "-private.html", enable private browsing.
-    if (window.location.href.endsWith("-private.html"))
+    if (window.location.href.endsWith("-private.html") || self.enablePrivateBrowsing)
         testRunner.setPrivateBrowsingEnabled(true);
 }
 

Added: trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-expected.txt (0 => 196137)


--- trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-expected.txt	2016-02-04 19:46:47 UTC (rev 196137)
@@ -0,0 +1,14 @@
+This test makes sure that array IDBKeys are correctly compared for equality during object store additions.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Successfully added all 500 array keys, without any conflicts.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-private-expected.txt (0 => 196137)


--- trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-private-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-private-expected.txt	2016-02-04 19:46:47 UTC (rev 196137)
@@ -0,0 +1,14 @@
+This test makes sure that array IDBKeys are correctly compared for equality during object store additions.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+indexedDB = self.indexedDB || self.webkitIndexedDB || self.mozIndexedDB || self.msIndexedDB || self.OIndexedDB;
+
+indexedDB.deleteDatabase(dbname)
+indexedDB.open(dbname)
+Successfully added all 500 array keys, without any conflicts.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-private.html (0 => 196137)


--- trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-private.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality-private.html	2016-02-04 19:46:47 UTC (rev 196137)
@@ -0,0 +1,12 @@
+<html>
+<head>
+<script>
+enablePrivateBrowsing = true;
+</script>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality.html (0 => 196137)


--- trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality.html	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/idbkey-array-equality.html	2016-02-04 19:46:47 UTC (rev 196137)
@@ -0,0 +1,9 @@
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+<script src=""
+</body>
+</html>

Added: trunk/LayoutTests/storage/indexeddb/modern/resources/idbkey-array-equality.js (0 => 196137)


--- trunk/LayoutTests/storage/indexeddb/modern/resources/idbkey-array-equality.js	                        (rev 0)
+++ trunk/LayoutTests/storage/indexeddb/modern/resources/idbkey-array-equality.js	2016-02-04 19:46:47 UTC (rev 196137)
@@ -0,0 +1,33 @@
+description("This test makes sure that array IDBKeys are correctly compared for equality during object store additions.");
+
+indexedDBTest(prepareDatabase);
+
+var iterationCount = 500;
+var successCount = 0;
+function doAdd(objectStore, value)
+{
+    var key = [ 0, value ];
+    var request = objectStore.add("value", key);
+    request._onsuccess_ = function() {
+        if (++successCount == iterationCount) {
+            debug("Successfully added all 500 array keys, without any conflicts.");
+            finishJSTest();
+        }
+    };
+
+    request._onerror_ = function(event) {
+        debug("Error putting value into database (" + value + "): " + event.type);
+        finishJSTest();
+    }    
+}
+
+function prepareDatabase(event)
+{    
+    var transaction = event.target.transaction;
+    var database = event.target.result;
+
+    var objectStore = database.createObjectStore("TestObjectStore");
+    
+    for (var i = 0; i < iterationCount; ++i)
+        doAdd(objectStore, i);
+}

Modified: trunk/Source/WebCore/ChangeLog (196136 => 196137)


--- trunk/Source/WebCore/ChangeLog	2016-02-04 19:38:12 UTC (rev 196136)
+++ trunk/Source/WebCore/ChangeLog	2016-02-04 19:46:47 UTC (rev 196137)
@@ -1,3 +1,17 @@
+2016-02-04  Brady Eidson  <[email protected]>
+
+        Modern IDB: LayoutTest imported/w3c/indexeddb/keyorder-private.html is flaky.
+        https://bugs.webkit.org/show_bug.cgi?id=153438.
+
+        Reviewed by Alex Christensen.
+
+        Tests: storage/indexeddb/modern/idbkey-array-equality-private.html
+               storage/indexeddb/modern/idbkey-array-equality.html
+
+        * Modules/indexeddb/IDBKeyData.cpp:
+        (WebCore::IDBKeyData::loggingString):
+        (WebCore::IDBKeyData::operator==): Fix obvious bug.
+
 2016-02-04  Chris Dumez  <[email protected]>
 
         Unreviewed, fix the EFL clean build after r196123

Modified: trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp (196136 => 196137)


--- trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2016-02-04 19:38:12 UTC (rev 196136)
+++ trunk/Source/WebCore/Modules/indexeddb/IDBKeyData.cpp	2016-02-04 19:46:47 UTC (rev 196137)
@@ -276,7 +276,7 @@
         result = "<string> - " + m_stringValue;
         break;
     case KeyType::Date:
-        return String::format("Date m_type - %f", m_numberValue);
+        return String::format("<date> - %f", m_numberValue);
     case KeyType::Number:
         return String::format("<number> - %f", m_numberValue);
     case KeyType::Max:
@@ -356,13 +356,7 @@
     case KeyType::String:
         return m_stringValue == other.m_stringValue;
     case KeyType::Array:
-        if (m_arrayValue.size() != other.m_arrayValue.size())
-            return false;
-        for (size_t i = 0; i < m_arrayValue.size(); ++i) {
-            if (m_arrayValue[0] != other.m_arrayValue[0])
-                return false;
-        }
-        return true;
+        return m_arrayValue == other.m_arrayValue;
     }
     RELEASE_ASSERT_NOT_REACHED();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to