From: Kamil Nowac Date: Tue, 13 Jan 2015 11:04:08 +0000 (+0100) Subject: [Bookmark] TCT tests FIX X-Git-Tag: submit/tizen_tv/20150603.064601~1^2~634 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=36e01c49dbb13eefa46ee02de1c6d15a1f734644;p=platform%2Fcore%2Fapi%2Fwebapi-plugins.git [Bookmark] TCT tests FIX PASS RATE: 34 / 36 Change-Id: I5cd5d38bf071a81c6d4e1f05621a36a82f5596a2 Signed-off-by: Kamil Nowac --- diff --git a/src/bookmark/bookmark_api.js b/src/bookmark/bookmark_api.js index 99080557..7947a620 100644 --- a/src/bookmark/bookmark_api.js +++ b/src/bookmark/bookmark_api.js @@ -181,10 +181,8 @@ BookmarkProvider.prototype.getFolder = function() { throw new tizen.WebAPIException(tizen.WebAPIException.INVALID_VALUES_ERR); var obj = new tizen.BookmarkFolder(folder[0].title); - _edit.allow(); obj.id = folder[0].id; obj.parent = this.getFolder(folder[0].parentId); - _edit.disallow(); return obj; }; @@ -226,7 +224,6 @@ BookmarkProvider.prototype.getFolderItems = function() { obj = new tizen.BookmarkItem(item.title, item.url); _edit.allow(); obj.id = item.id; - obj.url = item.url; obj.parent = this.getFolder(item.parentId); _edit.disallow(); result.push(obj); @@ -272,7 +269,6 @@ tizen.BookmarkItem = function() { ]); var parent_; var id_ = null; - var url_; Object.defineProperties(this, { parent: { @@ -280,9 +276,8 @@ tizen.BookmarkItem = function() { return parent_; }, set: function(new_parent) { - if (_edit.canEdit) { + if (_edit.canEdit) parent_ = new_parent; - } }, enumerable: true, nullable: true @@ -298,24 +293,16 @@ tizen.BookmarkItem = function() { get: function() { return args.url; }, - set: function(new_url) { - if (_edit.canEdit) { - url_ = new_url; - } - }, enumerable: true, nullable: false }, id: { get: function() { - if (!id_) - return 0; return id_; }, set: function(new_id) { - if (_edit.canEdit) { + if (_edit.canEdit) id_ = new_id; - } }, enumerable: false, nullable: true @@ -343,9 +330,8 @@ tizen.BookmarkFolder = function() { return parent_; }, set: function(new_parent) { - if (_edit.canEdit) { + if (_edit.canEdit) parent_ = new_parent; - } }, enumerable: true, nullable: true @@ -359,14 +345,11 @@ tizen.BookmarkFolder = function() { }, id: { get: function() { - if (!id_) - return 0; return id_; }, set: function(new_id) { - if (_edit.canEdit) { + if (_edit.canEdit) id_ = new_id; - } }, enumerable: false, nullable: true diff --git a/src/bookmark/bookmark_instance.cc b/src/bookmark/bookmark_instance.cc index 211a816c..b4eeef58 100644 --- a/src/bookmark/bookmark_instance.cc +++ b/src/bookmark/bookmark_instance.cc @@ -6,6 +6,7 @@ #include #include +#include "common/logger.h" #include "common/platform_exception.h" #include "common/converter.h" @@ -93,7 +94,8 @@ void BookmarkInstance::Bookmark_get( obj[kType] = picojson::value(std::to_string(entry.bookmark_info.type)); obj[kParentId] = picojson::value(std::to_string( entry.bookmark_info.parent)); - obj[kUrl] = picojson::value(entry.bookmark_info.url); + if (!entry.bookmark_info.type) + obj[kUrl] = picojson::value(entry.bookmark_info.url); arr.push_back(picojson::value(obj)); } @@ -105,11 +107,10 @@ void BookmarkInstance::Bookmark_add( int saved_id =-1; bp_bookmark_info_fmt data = {0}; - data.title = const_cast(arg.get(kTitle).to_str().c_str()); + data.title = const_cast(arg.get(kTitle).to_str().c_str()); data.parent = arg.get(kParentId).get(); - data.type = arg.get(kType).get(); - data.url = const_cast(arg.get(kUrl).to_str().c_str()); - + data.type = arg.get(kType).get(); + data.url = const_cast(arg.get(kUrl).to_str().c_str()); if (bp_bookmark_adaptor_create(&saved_id) < 0) { ReportError(o); return;