<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
- <xs:import schemaLocation="common.xsd"/>
+ <xs:include schemaLocation="common.xsd"/>
<!--
Widget Access Request Policy <http://www.w3.org/TR/widgets-access/>
requires common.rnc
-->
<xs:element name="access">
<xs:complexType mixed="true">
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="foreignAttribute"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:foreignAttribute"/>
<xs:attribute name="origin" type="xs:string"/>
<!-- w3c policy testcases
<xs:attribute name="origin" use="required">
</xs:simpleType>
</xs:attribute>
-->
- <xs:attribute name="subdomains" type="data.boolean"/>
+ <xs:attribute name="subdomains" type="widgets:data.boolean"/>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:widgets="http://www.w3.org/ns/widgets">
- <xs:import namespace="http://www.w3.org/ns/widgets" schemaLocation="widgets.xsd"/>
+ <xs:include schemaLocation="local.xsd"/>
<xs:group name="extension">
<xs:sequence>
<xs:group name="foreignElement">
<xs:sequence>
<xs:choice minOccurs="0">
- <xs:group ref="widgets:local"/>
+ <xs:group ref="local"/>
</xs:choice>
</xs:sequence>
</xs:group>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" xmlns:widgets="http://www.w3.org/ns/widgets">
+ <xs:group name="local">
+ <xs:sequence>
+ <xs:any namespace="##other" processContents="skip"/>
+ </xs:sequence>
+ </xs:group>
+</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
- <xs:import schemaLocation="common.xsd"/>
+ <xs:include schemaLocation="common.xsd"/>
+ <xs:include schemaLocation="access.xsd"/>
+ <xs:include schemaLocation="updates.xsd"/>
<xs:import namespace="http://tizen.org/ns/widgets" schemaLocation="widgets.tizen.xsd"/>
<!--
Widget Packaging and Configuration <http://www.w3.org/TR/widgets/>
<xs:complexType>
<xs:complexContent>
<xs:extension base="widgets:group.widgetContent">
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
- <xs:attributeGroup ref="extension"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
+ <xs:attributeGroup ref="widgets:extension"/>
<xs:attribute name="id" type="xs:anyURI"/>
<xs:attribute name="defaultlocale"/>
<xs:attribute name="version"/>
- <xs:attribute name="min-version" type="data.versionNumber"/>
- <xs:attribute name="height" type="data.positiveNumber"/>
- <xs:attribute name="width" type="data.positiveNumber"/>
+ <xs:attribute name="min-version" type="widgets:data.versionNumber"/>
+ <xs:attribute name="height" type="widgets:data.positiveNumber"/>
+ <xs:attribute name="width" type="widgets:data.positiveNumber"/>
<xs:attribute name="viewmodes">
<xs:simpleType>
<xs:list>
<xs:element ref="tizen:app-widget" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
<xs:element ref="tizen:account" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
<xs:element ref="tizen:metadata" minOccurs="0" maxOccurs="unbounded" xmlns:tizen="http://tizen.org/ns/widgets"/>
- <xs:group ref="foreignElement"/>
+ <xs:element ref="tizen:splash" minOccurs="0" maxOccurs="1" xmlns:tizen="http://tizen.org/ns/widgets"/>
<!-- W3C testcases fail - should accept any element -->
+ <!-- <xs:group minOccurs="0" maxOccurs="unbounded" ref="widgets:foreignElement"/> -->
</xs:choice>
<xs:element ref="widgets:access"/>
- <xs:element ref="widgets:update-description"/>
+ <!-- <xs:element ref="widgets:update-description"/> -->
</xs:choice>
</xs:complexType>
<xs:element name="name">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="widgets:span"/>
- <xs:group ref="foreignElement"/>
+ <xs:group ref="widgets:foreignElement"/>
</xs:choice>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
- <xs:attributeGroup ref="extension"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
+ <xs:attributeGroup ref="widgets:extension"/>
<xs:attribute name="short"/>
</xs:complexType>
</xs:element>
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="widgets:span"/>
- <xs:group ref="foreignElement"/>
+ <xs:group ref="widgets:foreignElement"/>
</xs:choice>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
- <xs:attributeGroup ref="extension"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
+ <xs:attributeGroup ref="widgets:extension"/>
</xs:complexType>
</xs:element>
<xs:element name="icon">
<xs:complexType>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="foreignAttribute"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:foreignAttribute"/>
<!-- w3c testcase - must ignore
<xs:attribute name="src" use="required" type="xs:anyURI"/>
-->
<xs:attribute name="src" type="xs:anyURI"/>
- <xs:attribute name="height" type="data.positiveNumber"/>
- <xs:attribute name="width" type="data.positiveNumber"/>
+ <xs:attribute name="height" type="widgets:data.positiveNumber"/>
+ <xs:attribute name="width" type="widgets:data.positiveNumber"/>
</xs:complexType>
</xs:element>
<xs:element name="author">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="widgets:span"/>
- <xs:group ref="foreignElement"/>
+ <xs:group ref="widgets:foreignElement"/>
<!-- W3C testcases fail - should accept any element -->
</xs:choice>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
- <xs:attributeGroup ref="extension"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
+ <xs:attributeGroup ref="widgets:extension"/>
<xs:attribute name="href" type="xs:anyURI"/>
<xs:attribute name="email" type="xs:string"/>
<!-- fails W3C testcases
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="widgets:span"/>
- <xs:group ref="foreignElement"/>
+ <xs:group ref="widgets:foreignElement"/>
</xs:choice>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
- <xs:attributeGroup ref="extension"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
+ <xs:attributeGroup ref="widgets:extension"/>
<xs:attribute name="href" type="xs:anyURI"/>
</xs:complexType>
</xs:element>
<xs:element name="content">
<xs:complexType>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="foreignAttribute"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:foreignAttribute"/>
<!-- w3c testcase - ignore not valid
<xs:attribute name="src" use="required" type="xs:anyURI"/>
-->
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="widgets:param"/>
- <xs:group ref="foreignElement"/>
+ <xs:group ref="widgets:foreignElement"/>
</xs:choice>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
- <xs:attributeGroup ref="extension"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
+ <xs:attributeGroup ref="widgets:extension"/>
<!-- w3c tescase - must ignore
<xs:attribute name="name" use="required" type="xs:anyURI"/>
-->
<xs:attribute name="name" type="xs:anyURI"/>
- <xs:attribute name="required" type="data.boolean"/>
+ <xs:attribute name="required" type="widgets:data.boolean"/>
</xs:complexType>
</xs:element>
<xs:element name="param">
<xs:complexType mixed="true">
- <xs:group minOccurs="0" maxOccurs="unbounded" ref="foreignElement"/>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
- <xs:attributeGroup ref="extension"/>
+ <xs:group minOccurs="0" maxOccurs="unbounded" ref="widgets:foreignElement"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
+ <xs:attributeGroup ref="widgets:extension"/>
<xs:attribute name="name"/>
<xs:attribute name="value"/>
<!-- w3c testcase - must ignore
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element ref="widgets:span"/>
- <xs:group ref="foreignElement"/>
+ <xs:group ref="widgets:foreignElement"/>
</xs:choice>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
</xs:complexType>
</xs:element>
<xs:element name="preference">
<xs:complexType mixed="true">
- <xs:group minOccurs="0" maxOccurs="unbounded" ref="foreignElement"/>
- <xs:attributeGroup ref="global.attrs"/>
- <xs:attributeGroup ref="global.xml"/>
- <xs:attributeGroup ref="extension"/>
+ <xs:group minOccurs="0" maxOccurs="unbounded" ref="widgets:foreignElement"/>
+ <xs:attributeGroup ref="widgets:global.attrs"/>
+ <xs:attributeGroup ref="widgets:global.xml"/>
+ <xs:attributeGroup ref="widgets:extension"/>
<!-- w3c testcase -required but missing
<xs:attribute name="name" use="required"/>
-->
<xs:attribute name="name"/>
<xs:attribute name="value"/>
- <xs:attribute name="readonly" type="data.boolean"/>
+ <xs:attribute name="readonly" type="widgets:data.boolean"/>
</xs:complexType>
</xs:element>
</xs:schema>
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
- <xs:import schemaLocation="common.xsd"/>
+ <xs:include schemaLocation="common.xsd"/>
<!--
Widget Updates <http://www.w3.org/TR/widgets-updates/>
requires common.rnc
-->
<xs:element name="update-description">
<xs:complexType mixed="true">
- <xs:group minOccurs="0" maxOccurs="unbounded" ref="foreignElement"/>
- <xs:attributeGroup ref="foreignAttribute"/>
+ <xs:group minOccurs="0" maxOccurs="unbounded" ref="widgets:foreignElement"/>
+ <xs:attributeGroup ref="widgets:foreignAttribute"/>
<xs:attribute name="href" use="required" type="xs:anyURI"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="updatePeriodType">
<xs:restriction base="xs:float">
- <xs:minInclusive value="60"/>
+ <xs:minInclusive value="1800"/>
</xs:restriction>
</xs:simpleType>
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://www.w3.org/ns/widgets" xmlns:widgets="http://www.w3.org/ns/widgets">
<xs:include schemaLocation="packaging-configuration.xsd"/>
- <xs:include schemaLocation="access.xsd"/>
- <xs:include schemaLocation="updates.xsd"/>
<xs:import schemaLocation="common.xsd"/>
- <xs:group name="local">
- <xs:sequence>
- <xs:any namespace="##other" processContents="skip"/>
- </xs:sequence>
- </xs:group>
</xs:schema>
#git:framework/web/wrt-installer
Name: wrt-installer
Summary: Installer for tizen Webruntime
-Version: 0.1.85
+Version: 0.1.87
Release: 1
Group: Development/Libraries
License: Apache License, Version 2.0
}
}
+std::string WidgetUnzip::decryptDrmPackage(const std::string &source)
+{
+ LogInfo("Check DRM...");
+ // TODO : check drm
+ return source;
+}
+
void WidgetUnzip::unzipWgtFile(const std::string &source, const std::string &destination)
{
LogInfo("Prepare to unzip...");
-
+ std::string wgtFile;
Try
{
- m_zip.reset(new DPL::ZipInput(source));
+ wgtFile = decryptDrmPackage(source);
+ LogDebug("wgtFile : " << wgtFile);
+
+ m_zip.reset(new DPL::ZipInput(wgtFile));
LogInfo("Widget package comment: " << m_zip->GetGlobalComment());
// Widget package must not be empty
if (m_zip->empty()) {
- ThrowMsg(Exceptions::ZipEmpty, source);
+ ThrowMsg(Exceptions::ZipEmpty, wgtFile);
}
// Set iterator to first file
}
Catch(DPL::ZipInput::Exception::OpenFailed)
{
- ReThrowMsg(Exceptions::OpenZipFailed, source);
+ ReThrowMsg(Exceptions::OpenZipFailed, wgtFile);
}
Catch(DPL::ZipInput::Exception::SeekFileFailed)
{
- ThrowMsg(Exceptions::ExtractFileFailed, source);
+ ThrowMsg(Exceptions::ExtractFileFailed, wgtFile);
+ }
+ Catch(Exceptions::DrmDecryptFailed)
+ {
+ ReThrowMsg(Exceptions::ExtractFileFailed, wgtFile);
}
}
void unzipProgress(const std::string &destination);
void ExtractFile(DPL::ZipInput::File *input, const std::string
&destFileName);
+ std::string decryptDrmPackage(const std::string &source);
};
void* wrtInstaller;
std::string pluginPath;
};
-
-bool checkInitializeToPreload(std::string pkgid)
-{
- std::string RoManifest = "/usr/share/packages/" + pkgid + ".xml";
- std::string RwManifest = "/opt/share/packages/" + pkgid + ".xml";
-
- if (access(RwManifest.c_str(), F_OK) == 0 &&
- access(RoManifest.c_str(), F_OK) == 0) {
- LogDebug("This web app need to down update");
- return true;
- }
- return false;
-}
} // namespace anonymous
WrtInstaller::WrtInstaller(int argc, char **argv) :
{
LogDebug("Uninstalling widget ...");
LogDebug("Package name : " << m_name);
+ pkgmgr_pkginfo_h handle;
+ int ret = -1;
+ bool preload = false;
+
+ if (0 == pkgmgr_pkginfo_get_pkginfo(m_name.c_str(), &handle)) {
+ if (pkgmgr_pkginfo_is_preload(handle, &preload) < 0) {
+ LogError("Can't get package information : " << m_name);
+ }
+ }
- if (!checkInitializeToPreload(m_name)) {
+ if (preload) {
+ LogDebug("This web app need to initialize preload app");
wrt_uninstall_widget(m_name.c_str(), this,
- &staticWrtStatusCallback,
+ &staticWrtInitializeToPreloadCallback,
(m_installByPkgmgr)
? &staticWrtUninstallProgressCallback : NULL,
pkgmgrSignalInterface);
} else {
wrt_uninstall_widget(m_name.c_str(), this,
- &staticWrtInitializeToPreloadCallback,
+ &staticWrtStatusCallback,
(m_installByPkgmgr)
? &staticWrtUninstallProgressCallback : NULL,
pkgmgrSignalInterface);
${CMAKE_CURRENT_SOURCE_DIR}/NPluginsInstallTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/ParsingTizenAppcontrolTests.cpp
${CMAKE_CURRENT_SOURCE_DIR}/WidgetUpdateTests.cpp
+ ${CMAKE_CURRENT_SOURCE_DIR}/PluginsInstallation.cpp
)
SET(INSTALLER_TESTS_TARGET "wrt-installer-tests-general")
--- /dev/null
+/*
+ * Copyright (c) 2013 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/**
+ * @file PluginsInstallation.cpp
+ * @author Tomasz Iwanek (t.iwanek@samsung.com)
+ * @version 1.0
+ * @brief PluginsInstallation tests implementation
+ */
+
+#include <string>
+#include <dpl/test/test_runner.h>
+#include <dpl/log/log.h>
+#include <dpl/wrt-dao-ro/plugin_dao_read_only.h>
+
+////////////////////////////////////////////////////////////////////////////////
+
+RUNNER_TEST_GROUP_INIT(PluginsInstallation)
+
+#define MAKE_PLUGIN_CHECK_TESTCASE(TESTCASE, LIBNAME) \
+ RUNNER_TEST(PluginsInstallation_##TESTCASE) \
+ { \
+ Try { \
+ WrtDB::PluginDAOReadOnly pdao(#LIBNAME); \
+ RUNNER_ASSERT_MSG(pdao.getInstallationStatus() == WrtDB::PluginDAOReadOnly::INSTALLATION_COMPLETED, "Plugin is not installed correctly"); \
+ } Catch(DPL::Exception) { \
+ LogError(_rethrown_exception.DumpToString()); \
+ RUNNER_ASSERT_MSG(false, "DPL::Exception"); \
+ } \
+ } \
+
+MAKE_PLUGIN_CHECK_TESTCASE(contact, libwrt-plugins-tizen-contact.so)
+MAKE_PLUGIN_CHECK_TESTCASE(systemsetting, libwrt-plugins-tizen-systemsetting.so)
+MAKE_PLUGIN_CHECK_TESTCASE(systeminfo, libwrt-plugins-tizen-systeminfo.so)
+MAKE_PLUGIN_CHECK_TESTCASE(nfc, libwrt-plugins-tizen-nfc.so)
+MAKE_PLUGIN_CHECK_TESTCASE(content, libwrt-plugins-tizen-content.so)
+MAKE_PLUGIN_CHECK_TESTCASE(alarm, libwrt-plugins-tizen-alarm.so)
+MAKE_PLUGIN_CHECK_TESTCASE(power, libwrt-plugins-tizen-power.so)
+MAKE_PLUGIN_CHECK_TESTCASE(secureelement, libwrt-plugins-tizen-secureelement.so)
+MAKE_PLUGIN_CHECK_TESTCASE(timeutil, libwrt-plugins-tizen-timeutil.so)
+MAKE_PLUGIN_CHECK_TESTCASE(calendar, libwrt-plugins-tizen-calendar.so)
+MAKE_PLUGIN_CHECK_TESTCASE(datacontrol, libwrt-plugins-tizen-datacontrol.so)
+MAKE_PLUGIN_CHECK_TESTCASE(bookmark, libwrt-plugins-tizen-bookmark.so)
+MAKE_PLUGIN_CHECK_TESTCASE(messaging, libwrt-plugins-tizen-messaging.so)
+MAKE_PLUGIN_CHECK_TESTCASE(messageport, libwrt-plugins-tizen-messageport.so)
+MAKE_PLUGIN_CHECK_TESTCASE(datasync, libwrt-plugins-tizen-datasync.so)
+MAKE_PLUGIN_CHECK_TESTCASE(networkbearerselection, libwrt-plugins-tizen-networkbearerselection.so)
+MAKE_PLUGIN_CHECK_TESTCASE(package, libwrt-plugins-tizen-package.so)
+MAKE_PLUGIN_CHECK_TESTCASE(filesystem, libwrt-plugins-tizen-filesystem.so)
+MAKE_PLUGIN_CHECK_TESTCASE(download, libwrt-plugins-tizen-download.so)
+MAKE_PLUGIN_CHECK_TESTCASE(application, libwrt-plugins-tizen-application.so)
+MAKE_PLUGIN_CHECK_TESTCASE(notification, libwrt-plugins-tizen-notification.so)
+MAKE_PLUGIN_CHECK_TESTCASE(push, libwrt-plugins-tizen-push.so)
+MAKE_PLUGIN_CHECK_TESTCASE(tizen, libwrt-plugins-tizen-tizen.so)
+MAKE_PLUGIN_CHECK_TESTCASE(callhistory, libwrt-plugins-tizen-callhistory.so)
+MAKE_PLUGIN_CHECK_TESTCASE(bluetooth, libwrt-plugins-tizen-bluetooth.so)