Hi!

In [0] Anis explains that each platform has to provide a handler for
installing/uninstalling at least files of the type "source-file", even
if they do nothing. Now, AIUI, source-file refers to adding
platform-specific source code which ends up as "native" code (C#,
java, objective C ,etc.).

I tend to look at FirefoxOS when I implement corresponding support for
Tizen, because the two platforms share one important characteristic:
All functionality needed to provide the APIs offered by plugins is
itself available as JavaScript. So, there's no need for any "native"
code. All plugins are basically wrappers around existing JS objects
provided by the underlying runtime.

So, my (n00bish) questions are:

- Why does FirefoxOS have an implementation of source-file,
header-file, resource-file, framework, lib-file that does anything
other than nothing? The fact that there's no firefoxos.spec.js that
tests any of those install/uninstall routines strongly suggests to me
that they are, in fact, stubs, or, at worst, incorrect code that
nevertheless never gets executed.

- Knowing that Tizen will never need to distribute any "native" source
files, can I just add two empty functions for the install/uninstall of
each of "source-file", "header-file", "library", etc.?

- If I do the above, I cannot really add a test to tizen.spec.js for a
function that does nothing. Is it OK to not have such tests?

I ask these questions because I would like to write good tests for the
Tizen plugman support, as per Anis' final comment[1] on my plugman
PR[2] and I got kinda stuck trying to write a test for source-file,
because I copied the implementation verbatim from FirefoxOS, and
there's no firefoxos.spec.js that would allow me to see how these
install/uninstall routines are supposed to be tested for a platform
that will never use them, and synthetically adding source files,
header files, and stuff like that to the Tizen-specific section of the
dummy plugin for the specific purpose of testing code that will never
be used seems like a waste of time.

Please help a n00b out :)



Gabriel

[0] https://github.com/apache/cordova-plugman/pull/67#discussion_r11004412
[1] https://github.com/apache/cordova-plugman/pull/67#issuecomment-38799304
[2] https://github.com/apache/cordova-plugman/pull/67

Reply via email to