1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/mozapps/extensions/test/xpcshell/test_bug616841.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,26 @@ 1.4 +/* Any copyright is dedicated to the Public Domain. 1.5 + * http://creativecommons.org/publicdomain/zero/1.0/ 1.6 + */ 1.7 + 1.8 +// Tests that string comparisons work correctly in callbacks 1.9 + 1.10 +function test_string_compare() { 1.11 + do_check_true("C".localeCompare("D") < 0); 1.12 + do_check_true("D".localeCompare("C") > 0); 1.13 + do_check_true("\u010C".localeCompare("D") < 0); 1.14 + do_check_true("D".localeCompare("\u010C") > 0); 1.15 +} 1.16 + 1.17 +function run_test() { 1.18 + createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2"); 1.19 + startupManager(); 1.20 + 1.21 + do_test_pending(); 1.22 + 1.23 + test_string_compare(); 1.24 + 1.25 + AddonManager.getAddonByID("foo", function(aAddon) { 1.26 + test_string_compare(); 1.27 + do_execute_soon(do_test_finished); 1.28 + }); 1.29 +}