Fix Gerrit, should honor global init
Change-Id: Ibec762d85280c1bf5d0f55a862cdd7202ebabcf8
This commit is contained in:
@@ -75,7 +75,7 @@ function flushPreinstalls() {
|
||||
export const _testOnly_flushPreinstalls = flushPreinstalls;
|
||||
|
||||
export function initGerritPluginApi() {
|
||||
window.Gerrit = {};
|
||||
window.Gerrit = window.Gerrit || {};
|
||||
flushPreinstalls();
|
||||
initGerritPluginsMethods(window.Gerrit as GerritGlobal);
|
||||
// Preloaded plugins should be installed after Gerrit.install() is set,
|
||||
|
||||
@@ -31,6 +31,7 @@ import {_testOnly_getShortcutManagerInstance} from '../mixins/keyboard-shortcut-
|
||||
import sinon from 'sinon/pkg/sinon-esm.js';
|
||||
import {safeTypesBridge} from '../utils/safe-types-util.js';
|
||||
import {_testOnly_initGerritPluginApi} from '../elements/shared/gr-js-api-interface/gr-gerrit.js';
|
||||
import {initGlobalVariables} from '../elements/gr-app-global-var-init.js';
|
||||
window.sinon = sinon;
|
||||
|
||||
security.polymer_resin.install({
|
||||
@@ -60,6 +61,9 @@ window.fixture = function(fixtureId, model) {
|
||||
};
|
||||
|
||||
setup(() => {
|
||||
window.Gerrit = {};
|
||||
initGlobalVariables();
|
||||
|
||||
// If the following asserts fails - then window.stub is
|
||||
// overwritten by some other code.
|
||||
assert.equal(cleanups.length, 0);
|
||||
|
||||
Reference in New Issue
Block a user