Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_measure_exceptions.htm

Issue 1191043004: Import hr-time and user-timing tests, remove redundant webperf copies (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add idlharness result Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_measure_exceptions.htm
diff --git a/LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_measure_exceptions.htm b/LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_measure_exceptions.htm
deleted file mode 100644
index 9a21c2311a85dce5473209102f64e9fa87e95bfa..0000000000000000000000000000000000000000
--- a/LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_measure_exceptions.htm
+++ /dev/null
@@ -1,282 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8" />
- <title>window.performance User Timing measure() method is throwing the proper exceptions</title>
- <link rel="author" title="Microsoft" href="http://www.microsoft.com/" />
- <link rel="help" href="http://127.0.0.1:8000/webperf/specs/UserTiming/#dom-performance-measure"/>
- <script src="/w3c/resources/testharness.js"></script>
- <script src="/w3c/resources/testharnessreport.js"></script>
- <script src="/w3c/webperf/resources/webperftestharness.js"></script>
-
- <script type="text/javascript">
- // navigation timing attributes
- var timingAttributes = [
- 'connectEnd',
- 'connectStart',
- 'domComplete',
- 'domContentLoadedEventEnd',
- 'domContentLoadedEventStart',
- 'domInteractive',
- 'domLoading',
- 'domainLookupEnd',
- 'domainLookupStart',
- 'fetchStart',
- 'loadEventEnd',
- 'loadEventStart',
- 'navigationStart',
- 'redirectEnd',
- 'redirectStart',
- 'requestStart',
- 'responseEnd',
- 'responseStart',
- 'unloadEventEnd',
- 'unloadEventStart'
- ];
-
- // test data
- var zeroedNavTimingAtt = undefined;
-
- setup({timeout:1000, explicit_done: true});
-
- test_namespace();
-
- function onload_test()
- {
- // test for existance of User Timing and Performance Timeline interface
- if (window.performance.mark == undefined ||
- window.performance.clearMarks == undefined ||
- window.performance.measure == undefined ||
- window.performance.clearMeasures == undefined ||
- window.performance.getEntriesByName == undefined ||
- window.performance.getEntriesByType == undefined ||
- window.performance.getEntries == undefined)
- {
- test_true(false,
- "The User Timing and Performance Timeline interfaces, which are required for this test, " +
- "are defined.");
-
- done();
- }
- else
- {
- test_measure_exceptions();
- }
- }
-
- function test_measure_exceptions()
- {
- // test scenarios for the SYNTAX_ERR exception
- try
- {
- // create the measure
- window.performance.measure("measure", "mark");
-
- test_true(false,
- "window.performance.measure(\"measure\", \"mark\"), where \"mark\" is a non-existent mark, " +
- "threw an exception.");
- }
- catch(e)
- {
- test_true(true,
- "window.performance.measure(\"measure\", \"mark\"), where \"mark\" is a non-existent mark, " +
- " threw an exception.");
-
- test_equals(e.code,
- e.SYNTAX_ERR,
- "window.performance.measure(\"measure\", \"mark\"), where \"mark\" is a non-existent " +
- "mark, threw a SYNTAX_ERR exception.");
- }
-
- try
- {
- // create the measure
- window.performance.measure("measure", "mark", "responseEnd");
-
- test_true(false,
- "window.performance.measure(\"measure\", \"mark\", \"responseEnd\"), where \"mark\" is a " +
- "non-existent mark, threw an exception.");
- }
- catch(e)
- {
- test_true(true,
- "window.performance.measure(\"measure\", \"mark\", \"responseEnd\"), where \"mark\" is a " +
- "non-existent mark, threw an exception.");
-
- test_equals(e.code,
- e.SYNTAX_ERR,
- "window.performance.measure(\"measure\", \"mark\", \"responseEnd\"), where \"mark\" is a " +
- "non-existent mark, threw a SYNTAX_ERR exception.");
- }
-
- try
- {
- // create the measure
- window.performance.measure("measure", "navigationStart", "mark");
-
- test_true(false,
- "window.performance.measure(\"measure\", \"navigationStart\", \"mark\"), where \"mark\" is " +
- "a non-existent mark, threw an exception.");
- }
- catch(e)
- {
- test_true(true,
- "window.performance.measure(\"measure\", \"navigationStart\", \"mark\"), where \"mark\" is " +
- "a non-existent mark, threw an exception.");
-
- test_equals(e.code,
- e.SYNTAX_ERR,
- "window.performance.measure(\"measure\", \"navigationStart\", \"mark\"), where \"mark\" " +
- "is a non-existent mark, threw a SYNTAX_ERR exception.");
- }
-
- try
- {
- // create the measure
- window.performance.measure("measure", "mark", "mark");
-
- test_true(false,
- "window.performance.measure(\"measure\", \"mark\", \"mark\"), where \"mark\" is a " +
- "non-existent mark, threw an exception.");
- }
- catch(e)
- {
- test_true(true,
- "window.performance.measure(\"measure\", \"mark\", \"mark\"), where \"mark\" is a " +
- "non-existent mark, threw an exception.");
-
- test_equals(e.code,
- e.SYNTAX_ERR,
- "window.performance.measure(\"measure\", \"mark\", \"mark\"), where \"mark\" is a " +
- "non-existent mark, threw a SYNTAX_ERR exception.");
- }
-
-
- // for testing the INVALID_ACCESS_ERR exception, find a navigation timing attribute with a value of zero
- for (var i in timingAttributes)
- {
- if (window.performance.timing[timingAttributes[i]] == 0)
- {
- zeroedNavTimingAtt = timingAttributes[i];
- }
- }
-
- if (zeroedNavTimingAtt == undefined)
- {
- test_true(false,
- "A navigation timing attribute with a value of 0 was not found to test for the " +
- "INVALID_ACCESS_ERR exception thrown by window.performance.measure().");
- }
- else
- {
- try
- {
- // create the measure
- window.performance.measure("measure", zeroedNavTimingAtt);
-
- test_true(false,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\"), where \"" +
- zeroedNavTimingAtt + "\" is a navigation timing attribute with a value of 0, threw an " +
- "exception.");
- }
- catch(e)
- {
- test_true(true,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\"), where \"" +
- zeroedNavTimingAtt + "\" is a navigation timing attribute with a value of 0, threw an " +
- "exception.");
-
- test_equals(e.code,
- e.INVALID_ACCESS_ERR,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\"), where \"" +
- zeroedNavTimingAtt + "\" is a navigation timing attribute with a value of 0, threw " +
- "an INVALID_ACCESS_ERR exception.");
- }
-
- try
- {
- // create the measure
- window.performance.measure("measure", zeroedNavTimingAtt, "responseEnd");
-
- test_true(false,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\", " +
- "\"responseEnd\"), where \"" + zeroedNavTimingAtt + "\" is a navigation timing " +
- "attribute with a value of 0, threw an exception.");
- }
- catch(e)
- {
- test_true(true,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\", " +
- "\"responseEnd\"), where \"" + zeroedNavTimingAtt + "\" is a navigation timing " +
- "attribute with a value of 0, threw an exception.");
-
- test_equals(e.code,
- e.INVALID_ACCESS_ERR,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\", " +
- "\"responseEnd\"), where \"" + zeroedNavTimingAtt + "\" is a navigation timing " +
- "attribute with a value of 0, threw an INVALID_ACCESS_ERR exception.");
- }
-
- try
- {
- // create the measure
- window.performance.measure("measure", "navigationStart", zeroedNavTimingAtt);
-
- test_true(false,
- "window.performance.measure(\"measure\", \"navigationStart\", \"" + zeroedNavTimingAtt +
- "\"), where \"" + zeroedNavTimingAtt + "\" is a navigation timing attribute with a " +
- "value of 0, threw an exception.");
- }
- catch(e)
- {
- test_true(true,
- "window.performance.measure(\"measure\", \"navigationStart\", \"" + zeroedNavTimingAtt +
- "\"), where \"" + zeroedNavTimingAtt + "\" is a navigation timing attribute with a " +
- "value of 0, threw an exception.");
-
- test_equals(e.code,
- e.INVALID_ACCESS_ERR,
- "window.performance.measure(\"measure\", \"navigationStart\", \"" + zeroedNavTimingAtt +
- "\"), where \"" + zeroedNavTimingAtt + "\" is a navigation timing attribute with a " +
- "value of 0, threw an INVALID_ACCESS_ERR exception.");
- }
-
- try
- {
- // create the measure
- window.performance.measure("measure", zeroedNavTimingAtt, zeroedNavTimingAtt);
-
- test_true(false,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\", \"" +
- zeroedNavTimingAtt + "\"), where \"" + zeroedNavTimingAtt + "\" is a navigation timing " +
- "attribute with a value of 0, threw an exception.");
- }
- catch(e)
- {
- test_true(true,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\", \"" +
- zeroedNavTimingAtt + "\"), where \"" + zeroedNavTimingAtt + "\" is a navigation timing " +
- "attribute with a value of 0, threw an exception.");
-
- test_equals(e.code,
- e.INVALID_ACCESS_ERR,
- "window.performance.measure(\"measure\", \"" + zeroedNavTimingAtt + "\", \"" +
- zeroedNavTimingAtt + "\"), where \"" + zeroedNavTimingAtt + "\" is a navigation " +
- "timing attribute with a value of 0, threw an INVALID_ACCESS_ERR exception.");
- }
- }
-
- done();
- }
- </script>
- </head>
- <body onload="onload_test();">
- <h1>Description</h1>
- <p>This test validates that the performance.measure() method throws a SYNTAX_ERR exception whenever a
- non-existent mark is provided as the startMark or endMark, and the method also throws a INVALID_ACCESS_ERR
- whenever a navigation timing attribute with a value of zero is provided as the startMark or endMark.
- </p>
-
- <div id="log"></div>
- </body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698