Merge "Fix plugin counting for plugins with multiple UI plugins"
This commit is contained in:
@@ -33,7 +33,7 @@ limitations under the License.
|
|||||||
</test-fixture>
|
</test-fixture>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
suite('gr-diff tests', () => {
|
suite('gr-plugin-host tests', () => {
|
||||||
let element;
|
let element;
|
||||||
let sandbox;
|
let sandbox;
|
||||||
let url;
|
let url;
|
||||||
@@ -54,8 +54,8 @@ limitations under the License.
|
|||||||
sandbox.stub(Gerrit, '_setPluginsCount');
|
sandbox.stub(Gerrit, '_setPluginsCount');
|
||||||
element.config = {
|
element.config = {
|
||||||
plugin: {
|
plugin: {
|
||||||
html_resource_paths: ['foo/bar', 'baz'],
|
html_resource_paths: ['plugins/foo/bar', 'plugins/baz'],
|
||||||
js_resource_paths: ['42'],
|
js_resource_paths: ['plugins/42'],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
assert.isTrue(Gerrit._setPluginsCount.calledWith(3));
|
assert.isTrue(Gerrit._setPluginsCount.calledWith(3));
|
||||||
|
|||||||
@@ -351,6 +351,15 @@ limitations under the License.
|
|||||||
return Gerrit.awaitPluginsLoaded();
|
return Gerrit.awaitPluginsLoaded();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('multiple ui plugins per java plugin', () => {
|
||||||
|
const file1 = 'http://test.com/plugins/qaz/static/foo.nocache.js';
|
||||||
|
const file2 = 'http://test.com/plugins/qaz/static/bar.js';
|
||||||
|
Gerrit._setPluginsPending([file1, file2]);
|
||||||
|
Gerrit.install(() => {}, '0.1', file1);
|
||||||
|
Gerrit.install(() => {}, '0.1', file2);
|
||||||
|
return Gerrit.awaitPluginsLoaded();
|
||||||
|
});
|
||||||
|
|
||||||
test('plugin install errors shows toasts', () => {
|
test('plugin install errors shows toasts', () => {
|
||||||
const alertStub = sandbox.stub();
|
const alertStub = sandbox.stub();
|
||||||
document.addEventListener('show-alert', alertStub);
|
document.addEventListener('show-alert', alertStub);
|
||||||
|
|||||||
@@ -561,7 +561,7 @@
|
|||||||
o[getPluginNameFromUrl(url)] = url;
|
o[getPluginNameFromUrl(url)] = url;
|
||||||
return o;
|
return o;
|
||||||
}, {});
|
}, {});
|
||||||
Gerrit._setPluginsCount(plugins.length);
|
Gerrit._setPluginsCount(Object.keys(_pluginsPending).length);
|
||||||
};
|
};
|
||||||
|
|
||||||
Gerrit._setPluginsCount = function(count) {
|
Gerrit._setPluginsCount = function(count) {
|
||||||
|
|||||||
Reference in New Issue
Block a user