From 2075042f8b7935c6ef88696a19342e49b2075c7a Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Wed, 12 Feb 2014 17:16:44 -0800 Subject: [PATCH] Bug 970336 - test_restrequest.js times out on Android 2.3 emulator; r=rnewman --HG-- extra : rebase_source : 686beb0c5ccfab3ebde27f554a3fa60439df5e53 extra : amend_source : 787e95b977f4557073f8c30b9e4e97269e6d1572 --- services/common/tests/unit/test_restrequest.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/common/tests/unit/test_restrequest.js b/services/common/tests/unit/test_restrequest.js index 0ad6a6a93f0..84ca624d085 100644 --- a/services/common/tests/unit/test_restrequest.js +++ b/services/common/tests/unit/test_restrequest.js @@ -717,8 +717,14 @@ add_test(function test_timeout() { do_check_eq(error.result, Cr.NS_ERROR_NET_TIMEOUT); do_check_eq(this.status, this.ABORTED); - _("Closing connection."); - server_connection.close(); + // server_connection is undefined on the Android emulator for reasons + // unknown. Yet, we still get here. If this test is refactored, we should + // investigate the reason why the above callback is behaving differently. + if (server_connection) { + _("Closing connection."); + server_connection.close(); + } + _("Shutting down server."); server.stop(run_next_test); });