Title: [179936] trunk/LayoutTests
Revision
179936
Author
[email protected]
Date
2015-02-11 10:33:14 -0800 (Wed, 11 Feb 2015)

Log Message

performance.now can crash if accessed from a window that has navigated
<rdar://problem/16892506>
https://bugs.webkit.org/show_bug.cgi?id=141478

Reviewed by Alexey Proskuryakov.

* fast/performance/performance-now-crash-on-navigated-window-expected.txt: Added.
* fast/performance/performance-now-crash-on-navigated-window.html: Added.
* fast/performance/resources: Added.
* fast/performance/resources/initialFrame.html: Added.
* fast/performance/resources/secondFrame.html: Added.
Add test for calling performance.now() on from a navigated window.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (179935 => 179936)


--- trunk/LayoutTests/ChangeLog	2015-02-11 18:09:53 UTC (rev 179935)
+++ trunk/LayoutTests/ChangeLog	2015-02-11 18:33:14 UTC (rev 179936)
@@ -1,3 +1,18 @@
+2015-02-11  Sam Weinig  <[email protected]>
+
+        performance.now can crash if accessed from a window that has navigated
+        <rdar://problem/16892506>
+        https://bugs.webkit.org/show_bug.cgi?id=141478
+
+        Reviewed by Alexey Proskuryakov.
+
+        * fast/performance/performance-now-crash-on-navigated-window-expected.txt: Added.
+        * fast/performance/performance-now-crash-on-navigated-window.html: Added.
+        * fast/performance/resources: Added.
+        * fast/performance/resources/initialFrame.html: Added.
+        * fast/performance/resources/secondFrame.html: Added.
+        Add test for calling performance.now() on from a navigated window.
+
 2015-02-10  Alexey Proskuryakov  <[email protected]>
 
         URL::setUser and URL::setPass don't percent encode

Added: trunk/LayoutTests/fast/performance/performance-now-crash-on-navigated-window-expected.txt (0 => 179936)


--- trunk/LayoutTests/fast/performance/performance-now-crash-on-navigated-window-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/performance/performance-now-crash-on-navigated-window-expected.txt	2015-02-11 18:33:14 UTC (rev 179936)
@@ -0,0 +1,10 @@
+Tests how the performance object works when it's owning window is not fully active due to navigation.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS value is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/performance/performance-now-crash-on-navigated-window.html (0 => 179936)


--- trunk/LayoutTests/fast/performance/performance-now-crash-on-navigated-window.html	                        (rev 0)
+++ trunk/LayoutTests/fast/performance/performance-now-crash-on-navigated-window.html	2015-02-11 18:33:14 UTC (rev 179936)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script>
+    jsTestIsAsync = true;
+    description("Tests how the performance object works when it's owning window is not fully active due to navigation.");
+
+    var perfFromInitialFrame;
+
+    // Called by initialFrame.html
+    function initialFrameLoaded()
+    {
+        var otherWindow = document.getElementById("frame").contentWindow;
+        perfFromInitialFrame = otherWindow.performance;
+        otherWindow.location.href = ""
+    }
+
+    // Called by secondFrame.html
+    function secondFrameLoaded()
+    {
+        // This should not crash.
+        value = perfFromInitialFrame.now();
+        
+        // Note: We return 0 for this because we need the Frame to get correct timing based on the document loader, and it our
+        // usual idiom to return a 'null-ish' value when the window is disconnected. Firefox returns a non-zero value here, but
+        // there doesn't seem to be anything in the spec that says it must.
+        shouldBe('value', '0');
+
+        finishJSTest();
+    }
+</script>
+<script src=""
+<iframe id="frame" src=""
+</body>
+</html>

Added: trunk/LayoutTests/fast/performance/resources/initialFrame.html (0 => 179936)


--- trunk/LayoutTests/fast/performance/resources/initialFrame.html	                        (rev 0)
+++ trunk/LayoutTests/fast/performance/resources/initialFrame.html	2015-02-11 18:33:14 UTC (rev 179936)
@@ -0,0 +1,4 @@
+<p>Initial Frame</p>
+<script>
+    top.initialFrameLoaded();
+</script>
\ No newline at end of file

Added: trunk/LayoutTests/fast/performance/resources/secondFrame.html (0 => 179936)


--- trunk/LayoutTests/fast/performance/resources/secondFrame.html	                        (rev 0)
+++ trunk/LayoutTests/fast/performance/resources/secondFrame.html	2015-02-11 18:33:14 UTC (rev 179936)
@@ -0,0 +1,4 @@
+<p>Second Frame</p>
+<script>
+    top.secondFrameLoaded();
+</script>
\ No newline at end of file
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to