Bug 361804 - StaticContextAdapter returns mock function (merge from HEAD) Also plugged a memory leak, where each test was retaining a lot of references to XPath engines and contexts.