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

Unified Diff: LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_clear_marks.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_clear_marks.htm
diff --git a/LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_clear_marks.htm b/LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_clear_marks.htm
deleted file mode 100644
index 2e978e5d2c351aac0315d5bcd6423e3b2aa3fedc..0000000000000000000000000000000000000000
--- a/LayoutTests/http/tests/w3c/webperf/approved/UserTiming/test_user_timing_clear_marks.htm
+++ /dev/null
@@ -1,134 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="UTF-8" />
- <title>window.performance User Timing clearMarks() method is working properly</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-clearmarks"/>
- <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">
- // test marks
- var markName1 = "mark1";
- var markName2 = "mark2";
- var markName3 = "markUndefined";
- var markTestDelay = 200;
- var entries;
- var pass;
-
- 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
- {
- // create a mark using the test delay; the mark's value should be equivalent to the loadEventStart
- // navigation timing attribute plus the test delay
- setTimeout(mark_test_cb, markTestDelay);
- }
- }
-
- function mark_test_cb()
- {
- // create the test marks; only create "mark1" and "mark2", "markUndefined" is a non-existent mark
- window.performance.mark(markName1);
- window.performance.mark(markName2);
-
- // test that two marks have been created
- entries = window.performance.getEntriesByType("mark");
- test_equals(entries.length, 2, "Two marks have been created for this test.");
-
- // clear non-existent mark
- window.performance.clearMarks(markName3);
-
- // test that "mark1" still exists
- entries = window.performance.getEntriesByName(markName1);
- test_true(entries[0].name == markName1,
- "After a call to window.performance.clearMarks(\"" + markName3 + "\"), where \"" + markName3 +
- "\" is a non-existent mark, window.performance.getEntriesByName(\"" + markName1 + "\") " +
- "returns an object containing the \"" + markName1 + "\" mark.");
-
- // test that "mark2" still exists
- entries = window.performance.getEntriesByName(markName2);
- test_true(entries[0].name == markName2,
- "After a call to window.performance.clearMarks(\"" + markName3 + "\"), where \"" + markName3 +
- "\" is a non-existent mark, window.performance.getEntriesByName(\"" + markName2 + "\") " +
- "returns an object containing the \"" + markName2 + "\" mark.");
-
- // clear existent mark
- window.performance.clearMarks(markName1);
-
- // test that "mark1" was cleared
- entries = window.performance.getEntriesByName(markName1);
- pass = true;
- for (var i in entries)
- {
- pass = false;
- }
- test_true(pass,
- "After a call to window.performance.clearMarks(\"" + markName1 + "\"), " +
- "window.performance.getEntriesByName(\"" + markName1 + "\") returns an empty object.");
-
- // test that "mark2" still exists
- entries = window.performance.getEntriesByName(markName2);
- test_true(entries[0].name == markName2,
- "After a call to window.performance.clearMarks(\"" + markName1 + "\"), " +
- "window.performance.getEntriesByName(\"" + markName2 + "\") returns an object containing the " +
- "\"" + markName2 + "\" mark.");
-
- // clear all marks
- window.performance.clearMarks();
-
- // test that all marks were cleared
- entries = window.performance.getEntriesByType("mark");
- pass = true;
- for (var i in entries)
- {
- pass = false;
- }
- test_true(pass,
- "After a call to window.performance.clearMarks(), " +
- "window.performance.getEntriesByType(\"mark\") returns an empty object.");
-
- done();
- }
- </script>
- </head>
- <body onload="onload_test();">
- <h1>Description</h1>
- <p>This test validates that the performance.clearMarks() method is working properly. This test creates the
- following marks to test this method:
- <ul>
- <li>"mark1"</li>
- <li>"mark2"</li>
- </ul>
- After creating each mark, performance.clearMarks() is called three times. First, it is provided with a name
- of "markUndefined", a non-existent mark, which shouldn't change the state of the Performance Timeline. Next,
- it is provided with a name of "mark2", after which, this mark should no longer be present in the Performance
- Timeline. Finally, performance.clearMarks() is called without any name provided. After this call, no marks
- should be present in the Performance Timeline. The state of the Performance Timeline is tested with the
- performance.getEntriesByType() and performance.getEntries() methods.
- </p>
-
- <div id="log"></div>
- </body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698