diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /js/ductwork/debugger/tests | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'js/ductwork/debugger/tests')
-rw-r--r-- | js/ductwork/debugger/tests/head_dbg.js | 17 | ||||
-rw-r--r-- | js/ductwork/debugger/tests/test_nativewrappers.js | 30 | ||||
-rw-r--r-- | js/ductwork/debugger/tests/xpcshell.ini | 8 |
3 files changed, 55 insertions, 0 deletions
diff --git a/js/ductwork/debugger/tests/head_dbg.js b/js/ductwork/debugger/tests/head_dbg.js new file mode 100644 index 000000000..0ffeed26b --- /dev/null +++ b/js/ductwork/debugger/tests/head_dbg.js @@ -0,0 +1,17 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; +const Cc = Components.classes; +const Ci = Components.interfaces; +const Cu = Components.utils; +const Cr = Components.results; + +function testGlobal(aName) { + let systemPrincipal = Cc["@mozilla.org/systemprincipal;1"] + .createInstance(Ci.nsIPrincipal); + + let sandbox = Cu.Sandbox(systemPrincipal); + Cu.evalInSandbox("this.__name = '" + aName + "'", sandbox); + return sandbox; +} diff --git a/js/ductwork/debugger/tests/test_nativewrappers.js b/js/ductwork/debugger/tests/test_nativewrappers.js new file mode 100644 index 000000000..9ee96701e --- /dev/null +++ b/js/ductwork/debugger/tests/test_nativewrappers.js @@ -0,0 +1,30 @@ +function run_test() +{ + Components.utils.import("resource://gre/modules/jsdebugger.jsm"); + addDebuggerToGlobal(this); + var g = testGlobal("test1"); + + var dbg = new Debugger(); + dbg.addDebuggee(g); + dbg.onDebuggerStatement = function(aFrame) { + let args = aFrame["arguments"]; + try { + args[0]; + do_check_true(true); + } catch(ex) { + do_check_true(false); + } + }; + + g.eval("function stopMe(arg) {debugger;}"); + + g2 = testGlobal("test2"); + g2.g = g; + g2.eval("(" + function createBadEvent() { + let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"].createInstance(Components.interfaces.nsIDOMParser); + let doc = parser.parseFromString("<foo></foo>", "text/xml"); + g.stopMe(doc.createEvent("MouseEvent")); + } + ")()"); + + dbg.enabled = false; +} diff --git a/js/ductwork/debugger/tests/xpcshell.ini b/js/ductwork/debugger/tests/xpcshell.ini new file mode 100644 index 000000000..cc60c2e4d --- /dev/null +++ b/js/ductwork/debugger/tests/xpcshell.ini @@ -0,0 +1,8 @@ +[DEFAULT] +head = head_dbg.js +tail = +skip-if = toolkit == 'android' + +[test_nativewrappers.js] +# Bug 685068 +fail-if = os == "android" |