All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v2 0/3] Patch Description
Date: Wed, 13 Oct 2010 15:19:30 -0500	[thread overview]
Message-ID: <4CB61452.7020200@gmail.com> (raw)
In-Reply-To: <1285869146-30183-1-git-send-email-gyagp0@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3510 bytes --]

Hi Yang,

On 09/30/2010 12:52 PM, Yang Gu wrote:
> This series of patches fix the compilation problem, as well as some memory leak. But the main focus is to enable Qt script so that phonesim GUI can be controlled using JavaScript. In the meantime, D-Bus support is added for the sake of test automation.
> 
> Here are several examples:
> 1. call.js (stands for incoming call and copy it to /tmp/call/)
> tabRegistration.gbIncomingCall.leCaller.text = "12345";
> tabRegistration.gbIncomingCall.pbIncomingCall.click();

So this is a great idea and all the patches have been pushed.  I've done
a couple of quick modifications afterward.  More info below.

> 
> Then we set the path of script and run the script with its name
> dbus-send --system --print-reply --dest=org.phonesim / org.phonesim.Script.SetPath string:/tmp/call
> dbus-send --system --print-reply --dest=org.phonesim / org.phonesim.Script.Run string:call.js
> 
> Now we have simulated an incoming call.
> 
> 2. sms.js (stands for incoming sms and copy it to /tmp/sms/)
> tabSMS.gbMessage1.leMessageSender.text = "Yang";
> tabSMS.gbMessage1.leSMSClass.text = "1";
> tabSMS.gbMessage1.teSMSText.setPlainText("This message is sent automatically from phonesim");
> tabSMS.gbMessage1.pbSendSMSMessage.click();
> 
> Then we do the similar things as first example:
> dbus-send --system --print-reply --dest=org.phonesim / org.phonesim.Script.SetPath string:/tmp/sms
> dbus-send --system --print-reply --dest=org.phonesim / org.phonesim.Script.Run string:sms.js
> 
> Now we have simulated an incoming sms.
> 
> 3. Get the current path for script
> dbus-send --system --print-reply --dest=org.phonesim / org.phonesim.Script.GetPath
> 
> 4. Make script return some string
> The string can be any string, number, bool, date, etc in JavaScript, but it couldn't be a object because of some side effect. Refer "QScriptValue Class Reference" for details.
> For example, if you want to know the current incoming number, you may write a script as below:
> // number.js
> tabRegistration.gbIncomingCall.leCaller.text
> 
> After running the script the similar way as above, you may get the number. 

This is really valuable information.  Can you submit a patch that adds a
quick document describing this functionality? Alternatively, adding a
new section to the HACKING file might be an option as well.

> 
> By the way, you may need below file (/etc/dbus-1/system.d/phonesim.conf) so that phonesim can register its service in system bus:
> <!-- This configuration file specifies the required security policies
>      for oFono core daemon to work. -->
> 
> <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
>  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
> <busconfig>
> 
>   <!-- ../system.conf have denied everything, so we just punch some holes -->
> 
>   <policy user="root">
>     <allow own="org.phonesim"/>
>     <allow send_destination="org.phonesim"/>
>   </policy>
> 
>   <policy at_console="true">
>     <allow send_destination="org.phonesim"/>
>   </policy>
> 
>   <policy context="default">
>     <deny send_destination="org.phonesim"/>
>   </policy>
> 
> </busconfig>
> 
> 

One of the changes I made was to have phonesim register to the system
bus.  This makes the above DBus configuration file unnecessary.  Running
phonesim on the system bus was too much of a security risk, and wasn't
really needed.

Regards,
-Denis

  parent reply	other threads:[~2010-10-13 20:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-30 17:52 [PATCH v2 0/3] Patch Description Yang Gu
2010-09-30 17:52 ` [PATCH v2 1/3] Move def of class ControlWidget to header file Yang Gu
2010-09-30 17:52 ` [PATCH v2 2/3] Some instances in ControlWidget need to be deleted Yang Gu
2010-09-30 17:52 ` [PATCH v2 3/3] Enable Qt Script Yang Gu
2010-10-13 20:19 ` Denis Kenzior [this message]
2010-10-14 11:17   ` [PATCH v2 0/3] Patch Description Gu, Yang
2010-10-14 11:23     ` Denis Kenzior

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4CB61452.7020200@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.