From a3afd5e130f155035280e1cd268035cc395b4e66 Mon Sep 17 00:00:00 2001 From: Josh Matthews Date: Fri, 13 Sep 2013 23:51:13 -0700 Subject: [PATCH] Add content harness timeout. --- src/test/html/content/harness.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/test/html/content/harness.js b/src/test/html/content/harness.js index ab4bf17ce70..add82ab9910 100644 --- a/src/test/html/content/harness.js +++ b/src/test/html/content/harness.js @@ -12,6 +12,18 @@ function is(a, b) { f(a + " == " + b); } +var _test_complete = false; +var _test_timeout = 10000; //10 seconds function finish() { + _test_complete = true; window.close(); -} \ No newline at end of file +} + +function _test_timed_out() { + if (!_test_complete) { + _fail('test timed out (' + _test_timeout/1000 + 's)'); + finish(); + } +} + +setTimeout(_test_timed_out, _test_timeout); \ No newline at end of file