blob: d6fb9703b7930a9fb4e9b7ffdf30a8fbc448aadf [file] [log] [blame]
Description
This test validates that the performance.measure() method is working properly when navigation timing attributes are used in place of mark names. This test creates the following measures to test this method:
"measure_nav_start_no_end": created using a measure() call with a navigation timing attribute provided as the startMark and nothing provided as the endMark
"measure_nav_start_mark_end": created using a measure() call with a navigation timing attribute provided as the startMark and a mark name provided as the endMark
"measure_mark_start_nav_end": created using a measure() call with a mark name provided as the startMark and a navigation timing attribute provided as the endMark
"measure_nav_start_nav_end":created using a measure() call with a navigation timing attribute provided as both the startMark and endMark
After creating each measure, the existence of these measures is validated by calling performance.getEntriesByName() with each measure name
PASS window.performance is defined
PASS window.performance.getEntriesByName("measure_nav_start_no_end")[0].name == "measure_nav_start_no_end"
PASS window.performance.getEntriesByName("measure_nav_start_no_end")[0].startTime is correct
PASS window.performance.getEntriesByName("measure_nav_start_no_end")[0].entryType == "measure"
PASS window.performance.getEntriesByName("measure_nav_start_no_end")[0].duration is approximately correct (up to 20ms difference allowed)
PASS window.performance.getEntriesByName("measure_nav_start_mark_end")[0].name == "measure_nav_start_mark_end"
PASS window.performance.getEntriesByName("measure_nav_start_mark_end")[0].startTime is correct
PASS window.performance.getEntriesByName("measure_nav_start_mark_end")[0].entryType == "measure"
PASS window.performance.getEntriesByName("measure_nav_start_mark_end")[0].duration is approximately correct (up to 20ms difference allowed)
PASS window.performance.getEntriesByName("measure_mark_start_nav_end")[0].name == "measure_mark_start_nav_end"
PASS window.performance.getEntriesByName("measure_mark_start_nav_end")[0].startTime is correct
PASS window.performance.getEntriesByName("measure_mark_start_nav_end")[0].entryType == "measure"
PASS window.performance.getEntriesByName("measure_mark_start_nav_end")[0].duration is approximately correct (up to 20ms difference allowed)
PASS window.performance.getEntriesByName("measure_nav_start_nav_end")[0].name == "measure_nav_start_nav_end"
PASS window.performance.getEntriesByName("measure_nav_start_nav_end")[0].startTime is correct
PASS window.performance.getEntriesByName("measure_nav_start_nav_end")[0].entryType == "measure"
PASS window.performance.getEntriesByName("measure_nav_start_nav_end")[0].duration is approximately correct (up to 20ms difference allowed)