OLD | NEW |
(Empty) | |
| 1 var performanceNamespace = window.performance; |
| 2 var namespace_check = false; |
| 3 function wp_test(func, msg, properties) |
| 4 { |
| 5 // only run the namespace check once |
| 6 if (!namespace_check) |
| 7 { |
| 8 namespace_check = true; |
| 9 |
| 10 if (performanceNamespace === undefined || performanceNamespace == null) |
| 11 { |
| 12 // show a single error that window.performance is undefined |
| 13 test(function() { assert_true(performanceNamespace !== undefined && perfor
manceNamespace != null, "window.performance is defined and not null"); }, "windo
w.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 relat
ed attributes. "}); |
| 14 } |
| 15 } |
| 16 |
| 17 test(func, msg, properties); |
| 18 } |
| 19 |
| 20 function test_true(value, msg, properties) |
| 21 { |
| 22 wp_test(function () { assert_true(value, msg); }, msg, properties); |
| 23 } |
| 24 |
| 25 function test_equals(value, equals, msg, properties) |
| 26 { |
| 27 wp_test(function () { assert_equals(value, equals, msg); }, msg, properties); |
| 28 } |
OLD | NEW |