[BlackBerry10] Fixed to fire deviceready event if there is no client script to load for any plugin
Reviewed by: Bryan Higgins <bhigg...@blackberry.com> Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/b5dc1237 Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/b5dc1237 Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/b5dc1237 Branch: refs/heads/master Commit: b5dc12373a75cad961cfe7b6a516fb1988c32906 Parents: ad80640 Author: Rosa Tse <r...@blackberry.com> Authored: Tue Mar 26 13:59:23 2013 -0400 Committer: Bryan Higgins <bhigg...@blackberry.com> Committed: Fri May 3 09:49:38 2013 -0400 ---------------------------------------------------------------------- .../plugin/blackberry10/pluginUtils.js | 3 +++ test/blackberry10/test.pluginUtils.js | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cordova-js/blob/b5dc1237/lib/blackberry10/plugin/blackberry10/pluginUtils.js ---------------------------------------------------------------------- diff --git a/lib/blackberry10/plugin/blackberry10/pluginUtils.js b/lib/blackberry10/plugin/blackberry10/pluginUtils.js index 8545c71..aa49077 100644 --- a/lib/blackberry10/plugin/blackberry10/pluginUtils.js +++ b/lib/blackberry10/plugin/blackberry10/pluginUtils.js @@ -57,6 +57,9 @@ module.exports = { } } } + if (count === 0) { + callback(); + } }, getPlugins: function (success, error) { http://git-wip-us.apache.org/repos/asf/cordova-js/blob/b5dc1237/test/blackberry10/test.pluginUtils.js ---------------------------------------------------------------------- diff --git a/test/blackberry10/test.pluginUtils.js b/test/blackberry10/test.pluginUtils.js index d298c43..3fe83bb 100644 --- a/test/blackberry10/test.pluginUtils.js +++ b/test/blackberry10/test.pluginUtils.js @@ -45,7 +45,7 @@ describe('blackberry10 pluginUtils', function () { pluginUtils.loadClientJs(plugins, callback); expect(document.createElement).not.toHaveBeenCalled(); expect(document.head.appendChild).not.toHaveBeenCalled(); - expect(callback).not.toHaveBeenCalled(); + expect(callback).toHaveBeenCalled(); }); it('adds a script tag for 1 plugin', function () {