Title: [139777] trunk
Revision
139777
Author
[email protected]
Date
2013-01-15 12:57:59 -0800 (Tue, 15 Jan 2013)

Log Message

[User Timing] INVALID_ACCESS_ERR should be thrown if measuring from a 0 Nav Timing value
https://bugs.webkit.org/show_bug.cgi?id=106935

Reviewed by Tony Gentilcore.

Source/WebCore:

Test: http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html

* page/PerformanceUserTiming.cpp:
(WebCore::UserTiming::findExistingMarkStartTime):

LayoutTests:

* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt:
* http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (139776 => 139777)


--- trunk/LayoutTests/ChangeLog	2013-01-15 20:49:36 UTC (rev 139776)
+++ trunk/LayoutTests/ChangeLog	2013-01-15 20:57:59 UTC (rev 139777)
@@ -1,3 +1,13 @@
+2013-01-15  James Simonsen  <[email protected]>
+
+        [User Timing] INVALID_ACCESS_ERR should be thrown if measuring from a 0 Nav Timing value
+        https://bugs.webkit.org/show_bug.cgi?id=106935
+
+        Reviewed by Tony Gentilcore.
+
+        * http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt:
+        * http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html:
+
 2013-01-13  Dirk Schulze  <[email protected]>
 
         [CSS Filters] brightness() function doesn't work as specified

Modified: trunk/LayoutTests/http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt (139776 => 139777)


--- trunk/LayoutTests/http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt	2013-01-15 20:49:36 UTC (rev 139776)
+++ trunk/LayoutTests/http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt	2013-01-15 20:57:59 UTC (rev 139777)
@@ -10,4 +10,5 @@
 PASS Invocation of context.measure("Exception4", "NonExistMark1", "ExistMark") should throw SYNTAX_ERR Exception. 
 PASS Invocation of context.measure("Exception5", "ExistMark", "NonExistMark1") should throw SYNTAX_ERR Exception. 
 PASS Invocation of context.measure("Exception6", "NonExistMark1", "NonExistMark2") should throw SYNTAX_ERR Exception. 
+PASS Invocation of context.measure("Exception7", "redirectStart") should throw INVALID_ACCESS_ERR Exception. 
 

Modified: trunk/LayoutTests/http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html (139776 => 139777)


--- trunk/LayoutTests/http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html	2013-01-15 20:49:36 UTC (rev 139776)
+++ trunk/LayoutTests/http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html	2013-01-15 20:57:59 UTC (rev 139777)
@@ -25,6 +25,7 @@
         test_method_throw_exception('context.measure("Exception4", "NonExistMark1", "ExistMark")', 'SYNTAX_ERR');
         test_method_throw_exception('context.measure("Exception5", "ExistMark", "NonExistMark1")', 'SYNTAX_ERR');
         test_method_throw_exception('context.measure("Exception6", "NonExistMark1", "NonExistMark2")', 'SYNTAX_ERR');
+        test_method_throw_exception('context.measure("Exception7", "redirectStart")', 'INVALID_ACCESS_ERR');
         </script>
     </body>
 </html>

Modified: trunk/Source/WebCore/ChangeLog (139776 => 139777)


--- trunk/Source/WebCore/ChangeLog	2013-01-15 20:49:36 UTC (rev 139776)
+++ trunk/Source/WebCore/ChangeLog	2013-01-15 20:57:59 UTC (rev 139777)
@@ -1,3 +1,15 @@
+2013-01-15  James Simonsen  <[email protected]>
+
+        [User Timing] INVALID_ACCESS_ERR should be thrown if measuring from a 0 Nav Timing value
+        https://bugs.webkit.org/show_bug.cgi?id=106935
+
+        Reviewed by Tony Gentilcore.
+
+        Test: http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html
+
+        * page/PerformanceUserTiming.cpp:
+        (WebCore::UserTiming::findExistingMarkStartTime):
+
 2013-01-15  Tommy Widenflycht  <[email protected]>
 
         MediaStream API: Rename the [add|remove]Track callbacks to [add|remove]RemoteTrack for clarity

Modified: trunk/Source/WebCore/page/PerformanceUserTiming.cpp (139776 => 139777)


--- trunk/Source/WebCore/page/PerformanceUserTiming.cpp	2013-01-15 20:49:36 UTC (rev 139776)
+++ trunk/Source/WebCore/page/PerformanceUserTiming.cpp	2013-01-15 20:57:59 UTC (rev 139777)
@@ -123,8 +123,14 @@
     if (m_marksMap.contains(markName))
         return m_marksMap.get(markName).last()->startTime();
 
-    if (restrictedKeyMap().contains(markName))
-        return static_cast<double>((m_performance->timing()->*(restrictedKeyMap().get(markName)))()) - m_performance->timing()->navigationStart();
+    if (restrictedKeyMap().contains(markName)) {
+        double value = static_cast<double>((m_performance->timing()->*(restrictedKeyMap().get(markName)))());
+        if (!value) {
+            ec = INVALID_ACCESS_ERR;
+            return 0.0;
+        }
+        return value - m_performance->timing()->navigationStart();
+    }
 
     ec = SYNTAX_ERR;
     return 0.0;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to