Index: third_party/WebKit/LayoutTests/external/wpt/common/performance-timeline-utils.js |
diff --git a/third_party/WebKit/LayoutTests/external/wpt/common/performance-timeline-utils.js b/third_party/WebKit/LayoutTests/external/wpt/common/performance-timeline-utils.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..81f37ce3e208e2ec5776c9785b7694ece4f72ea4 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/common/performance-timeline-utils.js |
@@ -0,0 +1,28 @@ |
+var performanceNamespace = window.performance; |
+var namespace_check = false; |
+function wp_test(func, msg, properties) |
+{ |
+ // only run the namespace check once |
+ if (!namespace_check) |
+ { |
+ namespace_check = true; |
+ |
+ if (performanceNamespace === undefined || performanceNamespace == null) |
+ { |
+ // show a single error that window.performance is undefined |
+ test(function() { assert_true(performanceNamespace !== undefined && performanceNamespace != null, "window.performance is defined and not null"); }, "window.performance is defined and not null.", {author:"W3C http://www.w3.org/",help:"http://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute",assert:"The window.performance attribute provides a hosting area for performance related attributes. "}); |
+ } |
+ } |
+ |
+ test(func, msg, properties); |
+} |
+ |
+function test_true(value, msg, properties) |
+{ |
+ wp_test(function () { assert_true(value, msg); }, msg, properties); |
+} |
+ |
+function test_equals(value, equals, msg, properties) |
+{ |
+ wp_test(function () { assert_equals(value, equals, msg); }, msg, properties); |
+} |