Title: [217470] trunk/LayoutTests
Revision
217470
Author
[email protected]
Date
2017-05-25 19:56:11 -0700 (Thu, 25 May 2017)

Log Message

Gracefully handle missing localStorage support in results.html
https://bugs.webkit.org/show_bug.cgi?id=172625
<rdar://problem/32118243>

Reviewed by Alexey Proskuryakov.

Handle the case where localStorage generates a SecurityError DOMException, treating this
as a non-fatal error.

* fast/harness/results.html:
(OptionWriter.save): Treat "SecurityError" as an expected condition.
(OptionWriter.apply): Ditto.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (217469 => 217470)


--- trunk/LayoutTests/ChangeLog	2017-05-26 02:54:23 UTC (rev 217469)
+++ trunk/LayoutTests/ChangeLog	2017-05-26 02:56:11 UTC (rev 217470)
@@ -1,3 +1,18 @@
+2017-05-25  Brent Fulgham  <[email protected]>
+
+        Gracefully handle missing localStorage support in results.html
+        https://bugs.webkit.org/show_bug.cgi?id=172625
+        <rdar://problem/32118243>
+
+        Reviewed by Alexey Proskuryakov.
+
+        Handle the case where localStorage generates a SecurityError DOMException, treating this
+        as a non-fatal error.
+
+        * fast/harness/results.html:
+        (OptionWriter.save): Treat "SecurityError" as an expected condition.
+        (OptionWriter.apply): Ditto.
+
 2017-05-25  Alexey Proskuryakov  <[email protected]>
 
         Merge split script tests, part 2

Modified: trunk/LayoutTests/fast/harness/results.html (217469 => 217470)


--- trunk/LayoutTests/fast/harness/results.html	2017-05-26 02:54:23 UTC (rev 217469)
+++ trunk/LayoutTests/fast/harness/results.html	2017-05-26 02:56:11 UTC (rev 217470)
@@ -1297,12 +1297,24 @@
         var option = options[i];
         data[option.id] = option.checked;
     }
-    localStorage.setItem(OptionWriter._key, JSON.stringify(data));
+    try {
+        localStorage.setItem(OptionWriter._key, JSON.stringify(data));
+    } catch (err) {
+        if (err.name != "SecurityError")
+            throw err;
+    }
 }
 
 OptionWriter.apply = function()
 {
-    var json = localStorage.getItem(OptionWriter._key);
+    var json;
+    try {
+        json = localStorage.getItem(OptionWriter._key);
+    } catch (err) {
+       if (err.name != "SecurityError")
+          throw err;
+    }
+
     if (!json) {
         updateAllOptions();
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to