Previously, we removed the crash manager and moved its responsibilities to the error service. Because the crash manager was used in both the frontend and backend, and because the infrastructure code required to use the error service in the frontend hasn't been written yet, the crash manager has been moved to the frontend assets where it is still needed in the interim. Most of the logic of the crash manager has been moved to public_crash_manager (as it is now the only crash manager and it doesn't make sense to keep the inheritance hierarchy). References to the crash manager in the backend were adapted where needed or removed where they were no longer useful. closes odoo-dev/odoo#943 Related: odoo-dev/enterprise#174 Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
34 lines
1.2 KiB
JavaScript
34 lines
1.2 KiB
JavaScript
odoo.define("web.SessionOverrideForTests", (require) => {
|
|
// Override the Session.session_reload function
|
|
// The wowl test infrastructure does set a correct odoo global value before each test
|
|
// while the session is built only once for all tests.
|
|
// So if a test does a session_reload, it will merge the odoo global of that test
|
|
// into the session, and will alter every subsequent test of the suite.
|
|
// Obviously, we don't want that, ever.
|
|
const initialOdoo = Object.assign({}, odoo);
|
|
const Session = require("web.Session");
|
|
const { patch } = require("@web/core/utils/patch");
|
|
patch(Session.prototype, "web.SessionTestPatch", {
|
|
async session_reload() {
|
|
const oldOdoo = odoo;
|
|
odoo = initialOdoo;
|
|
const res = await this._super(...arguments);
|
|
odoo = oldOdoo;
|
|
return res;
|
|
},
|
|
});
|
|
});
|
|
|
|
odoo.define("web.test_legacy", async (require) => {
|
|
require("web.SessionOverrideForTests");
|
|
|
|
const legacyProm = new Promise(async (resolve) => {
|
|
const session = require("web.session");
|
|
await session.is_bound; // await for templates from server
|
|
require("web.test_utils");
|
|
resolve();
|
|
});
|
|
|
|
return { legacyProm };
|
|
});
|