Changeset 139777 in webkit


Ignore:
Timestamp:
Jan 15, 2013 12:57:59 PM (11 years ago)
Author:
simonjam@chromium.org
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:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r139770 r139777  
     12013-01-15  James Simonsen  <simonjam@chromium.org>
     2
     3        [User Timing] INVALID_ACCESS_ERR should be thrown if measuring from a 0 Nav Timing value
     4        https://bugs.webkit.org/show_bug.cgi?id=106935
     5
     6        Reviewed by Tony Gentilcore.
     7
     8        * http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt:
     9        * http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html:
     10
    1112013-01-13  Dirk Schulze  <dschulze@adobe.com>
    212
  • trunk/LayoutTests/http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception-expected.txt

    r131789 r139777  
    1111PASS Invocation of context.measure("Exception5", "ExistMark", "NonExistMark1") should throw SYNTAX_ERR Exception.
    1212PASS Invocation of context.measure("Exception6", "NonExistMark1", "NonExistMark2") should throw SYNTAX_ERR Exception.
     13PASS Invocation of context.measure("Exception7", "redirectStart") should throw INVALID_ACCESS_ERR Exception.
    1314
  • trunk/LayoutTests/http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html

    r131789 r139777  
    2626        test_method_throw_exception('context.measure("Exception5", "ExistMark", "NonExistMark1")', 'SYNTAX_ERR');
    2727        test_method_throw_exception('context.measure("Exception6", "NonExistMark1", "NonExistMark2")', 'SYNTAX_ERR');
     28        test_method_throw_exception('context.measure("Exception7", "redirectStart")', 'INVALID_ACCESS_ERR');
    2829        </script>
    2930    </body>
  • trunk/Source/WebCore/ChangeLog

    r139775 r139777  
     12013-01-15  James Simonsen  <simonjam@chromium.org>
     2
     3        [User Timing] INVALID_ACCESS_ERR should be thrown if measuring from a 0 Nav Timing value
     4        https://bugs.webkit.org/show_bug.cgi?id=106935
     5
     6        Reviewed by Tony Gentilcore.
     7
     8        Test: http/tests/w3c/webperf/submission/Intel/user-timing/test_user_timing_measure_exception.html
     9
     10        * page/PerformanceUserTiming.cpp:
     11        (WebCore::UserTiming::findExistingMarkStartTime):
     12
    1132013-01-15  Tommy Widenflycht  <tommyw@google.com>
    214
  • trunk/Source/WebCore/page/PerformanceUserTiming.cpp

    r136565 r139777  
    124124        return m_marksMap.get(markName).last()->startTime();
    125125
    126     if (restrictedKeyMap().contains(markName))
    127         return static_cast<double>((m_performance->timing()->*(restrictedKeyMap().get(markName)))()) - m_performance->timing()->navigationStart();
     126    if (restrictedKeyMap().contains(markName)) {
     127        double value = static_cast<double>((m_performance->timing()->*(restrictedKeyMap().get(markName)))());
     128        if (!value) {
     129            ec = INVALID_ACCESS_ERR;
     130            return 0.0;
     131        }
     132        return value - m_performance->timing()->navigationStart();
     133    }
    128134
    129135    ec = SYNTAX_ERR;
Note: See TracChangeset for help on using the changeset viewer.