From 43ed83248261190501de70255fbf566874b820d2 Mon Sep 17 00:00:00 2001 From: "jband%netscape.com" Date: Thu, 14 Feb 2002 06:01:54 +0000 Subject: [PATCH] add regression test for bug 125430. NOT PART OF THE BUILD --- js/src/xpconnect/tests/js/old/xpctest_echo.js | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/js/src/xpconnect/tests/js/old/xpctest_echo.js b/js/src/xpconnect/tests/js/old/xpctest_echo.js index ddc003cd425..aa54431f57a 100644 --- a/js/src/xpconnect/tests/js/old/xpctest_echo.js +++ b/js/src/xpconnect/tests/js/old/xpctest_echo.js @@ -401,6 +401,44 @@ foo = bar = iface = clazz = null; /***************************************************************************/ +var r = new Object(); +r.SetReceiver = function() {}; +r.SendOneString = function(str) {Components.returnCode = code; return null;} +echo.SetReceiver(r); +var all_ok = true; + +var code = Components.results.NS_OK; +try { + echo.SendOneString(""); +} catch(e) { + all_ok = false; +} + +var code = Components.results.NS_ERROR_FAILURE; +try { + echo.SendOneString(""); + all_ok = false; +} catch(e) { + if(e.result != code) + all_ok = false; +} + +var code = Components.results.NS_ERROR_NULL_POINTER; +try { + echo.SendOneString(""); + all_ok = false; +} catch(e) { + if(e.result != code) + all_ok = false; +} + +print("returnCode test - "+(all_ok ? "passed" : "failed")); + +echo.SetReceiver(null); +r = null; + +/***************************************************************************/ + print("......................................."); print("simple speed tests...");