You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2013/08/12 22:59:21 UTC
[5/7] git commit: [CB-3191] Support for tag (start page
declaration) in BlackBerry10.
[CB-3191] Support for <content> tag (start page declaration) in BlackBerry10.
Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/0dce191f
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/0dce191f
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/0dce191f
Branch: refs/heads/master
Commit: 0dce191f739f20e3f0a067da103a2c743ae75fac
Parents: 86ef079
Author: Fil Maj <ma...@gmail.com>
Authored: Mon Aug 12 13:28:57 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Mon Aug 12 13:28:57 2013 -0700
----------------------------------------------------------------------
spec/metadata/blackberry_parser.spec.js | 9 ++++++++-
src/metadata/blackberry10_parser.js | 2 ++
2 files changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0dce191f/spec/metadata/blackberry_parser.spec.js
----------------------------------------------------------------------
diff --git a/spec/metadata/blackberry_parser.spec.js b/spec/metadata/blackberry_parser.spec.js
index 3ba22da..354109e 100644
--- a/spec/metadata/blackberry_parser.spec.js
+++ b/spec/metadata/blackberry_parser.spec.js
@@ -87,8 +87,9 @@ describe('blackberry10 project parser', function() {
describe('update_from_config method', function() {
var et, xml, find, write_xml, root, cfg, find_obj, root_obj;
- var xml_name, xml_pkg, xml_version, xml_access_rm, xml_update, xml_append;
+ var xml_name, xml_pkg, xml_version, xml_access_rm, xml_update, xml_append, xml_content;
beforeEach(function() {
+ xml_content = jasmine.createSpy('xml content');
xml_name = jasmine.createSpy('xml name');
xml_pkg = jasmine.createSpy('xml pkg');
xml_version = jasmine.createSpy('xml version');
@@ -99,6 +100,7 @@ describe('blackberry10 project parser', function() {
p.xml.name = xml_name;
p.xml.packageName = xml_pkg;
p.xml.version = xml_version;
+ p.xml.content = xml_content;
p.xml.access = {
remove:xml_access_rm,
add: xml_access_add
@@ -126,6 +128,7 @@ describe('blackberry10 project parser', function() {
xml = spyOn(ET, 'XML');
cfg = new config_parser();
cfg.name = function() { return 'testname'; };
+ cfg.content = function() { return 'index.html'; };
cfg.packageName = function() { return 'testpkg'; };
cfg.version = function() { return 'one point oh'; };
cfg.access.getAttributes = function() { return []; };
@@ -154,6 +157,10 @@ describe('blackberry10 project parser', function() {
expect(xml_access_add).toHaveBeenCalledWith('one', undefined);
expect(xml_access_add).toHaveBeenCalledWith('two', 'false');
});
+ it('should update the start page (content tag)', function() {
+ p.update_from_config(cfg);
+ expect(xml_content).toHaveBeenCalledWith('index.html');
+ });
});
describe('www_dir method', function() {
it('should return /www', function() {
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/0dce191f/src/metadata/blackberry10_parser.js
----------------------------------------------------------------------
diff --git a/src/metadata/blackberry10_parser.js b/src/metadata/blackberry10_parser.js
index 79e303f..dbaf85b 100644
--- a/src/metadata/blackberry10_parser.js
+++ b/src/metadata/blackberry10_parser.js
@@ -61,6 +61,8 @@ module.exports.prototype = {
config.access.getAttributes().forEach(function(attribs) {
self.xml.access.add(attribs.uri || attribs.origin, attribs.subdomains);
});
+
+ this.xml.content(config.content());
},
update_project:function(cfg, callback) {
var self = this;