summaryrefslogtreecommitdiffstats
path: root/dbus/message_unittest.cc
Commit message (Collapse)AuthorAgeFilesLines
* Move eintr_wrapper.h from base to base/posixbrettw@chromium.org2012-11-141-1/+1
| | | | | | Review URL: https://codereview.chromium.org/11366229 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167739 0039d316-1c4b-4281-b951-d872f2087c98
* Expose functionality to tests.davemoore@chromium.org2012-07-251-1/+1
| | | | | | | | | | | Second try of https://chromiumcodereview.appspot.com/10815083 BUG=None TEST=None TBR=satorux Review URL: https://chromiumcodereview.appspot.com/10833011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148382 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Truncate strings in dbus::Message::ToString() if too longsatorux@chromium.org2012-06-071-0/+15
| | | | | | | | | | | To prevent long strings from polluting logs. BUG=131261 TEST=added a unit test Review URL: https://chromiumcodereview.appspot.com/10537033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141021 0039d316-1c4b-4281-b951-d872f2087c98
* Change setters of dbus::Message to return false instead of aborting on errorshashimoto@chromium.org2012-05-231-6/+36
| | | | | | | | | | | | With this change, we can safely return error for invalid object path and service name. It still crashes on invalid method name and interface name if we use MethodCall::MethodCall for setting those parameters. BUG=128967 TEST=dbus_unittests Review URL: https://chromiumcodereview.appspot.com/10409065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138441 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: revamp fd passing support for i/o restrictionssleffler@chromium.org2012-05-101-0/+9
| | | | | | | | | | | | | | Encapsulate file descriptor validity checking and status in the companion FileDescriptor class so callers can do descriptor checking in a context where i/o is allowed. Update the debug daemon client support to validate the pipe descriptors in a worker thread so it is not done on the UI thread. BUG=126142 TEST=new unit tests + collect trace data on chrome os and verify no assert is triggered Review URL: https://chromiumcodereview.appspot.com/10382021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@136331 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add support for passing file descriptorssleffler@chromium.org2012-03-301-0/+34
| | | | | | | | | | | | | | Add support for passing file descriptors in messages. BUG=chromium-os:27809 TEST=run unit tests Change-Id: I48e52e52ea1e1a4b96bb0dbec7242337e5871510 Review URL: http://codereview.chromium.org/9700072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129801 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add ObjectPath typekeybuk@google.com2012-02-141-19/+20
| | | | | | | | | | | | | | | | | | Rather than use std::string for object paths, add a dbus::ObjectPath type that wraps one while allowing more type-safety. This solves all sorts of issues with confusing object paths for strings, and allows us to do Properties code using templates disambiguating them from strings. BUG=chromium:109194 TEST=built and run tests Change-Id: Icaf6f19daea4af23a9d2ec0ed76d2cbd379d680e Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=121920 Review URL: https://chromiumcodereview.appspot.com/9378039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121941 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 121920 - dbus: add ObjectPath typedpapad@chromium.org2012-02-141-20/+19
| | | | | | | | | | | | | | | | | | | | Rather than use std::string for object paths, add a dbus::ObjectPath type that wraps one while allowing more type-safety. This solves all sorts of issues with confusing object paths for strings, and allows us to do Properties code using templates disambiguating them from strings. BUG=chromium:109194 TEST=built and run tests Change-Id: Icaf6f19daea4af23a9d2ec0ed76d2cbd379d680e Review URL: http://codereview.chromium.org/9378039 TBR=keybuk@chromium.org Review URL: https://chromiumcodereview.appspot.com/9363045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121923 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: add ObjectPath typekeybuk@chromium.org2012-02-141-19/+20
| | | | | | | | | | | | | | | | | Rather than use std::string for object paths, add a dbus::ObjectPath type that wraps one while allowing more type-safety. This solves all sorts of issues with confusing object paths for strings, and allows us to do Properties code using templates disambiguating them from strings. BUG=chromium:109194 TEST=built and run tests Change-Id: Icaf6f19daea4af23a9d2ec0ed76d2cbd379d680e Review URL: http://codereview.chromium.org/9378039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121920 0039d316-1c4b-4281-b951-d872f2087c98
* Adding support for sending/receiving proto bufs to dbus library.rharrison@chromium.org2012-02-091-0/+17
| | | | | | | | | | | | | | | | | | | This CL add in support to dbus wrapping classes to send and receive protocol buffers. They take in a generic MessageLite, which all protocol buffers inherit from. It will then serialize the buffer and send it out as an array of bytes. On receiving the array of bytes will be parsed back into a protocol buffer. The operations for doing this are very canned and these methods are designed to allow devs to skip writing boilerplate. The methods are just wrappers around the appopriate byte array methods. BUG=chromium:112127 TEST=Ran new unittests Review URL: http://codereview.chromium.org/9315006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121248 0039d316-1c4b-4281-b951-d872f2087c98
* chrome: dbus: add default MessageReader constructorkeybuk@chromium.org2012-02-071-16/+16
| | | | | | | | | | | | | | | | | | | | | There's no need for a dbus::MessageReader to be initialized with a message, the underlying DBusMessageIter is fully initialized by dbus_message_iter_recurse() as called by PopArray, etc. This allows for: dbus::MessageReader reader; other_reader->PopArray(&reader); BUG=none TEST=verified with arrays, variants and dictionary types. Change-Id: Id4a9d2de2b28ec3a2da42f822934a39865d9e9ef Review URL: http://codereview.chromium.org/9342009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120864 0039d316-1c4b-4281-b951-d872f2087c98
* dbus: Fix a bug where we rejected an empty array in PopArrayOfBytes()satorux@chromium.org2011-11-111-0/+15
| | | | | | | | | | | | | An empty array should be allowed. Sometimes, you need to send an empty array from methods and signals. BUG=103793 TEST=added a test in dbus_unittests Review URL: http://codereview.chromium.org/8525012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@109561 0039d316-1c4b-4281-b951-d872f2087c98
* Linux: add two new DBus client library utility functions, to be used by KWallet.mdm@chromium.org2011-09-191-6/+27
| | | | | | | | The new functions are AppendArrayOfStrings and PopArrayOfStrings, which have self-explanatory names. Currently the KWallet code does this looping itself. Review URL: http://codereview.chromium.org/7941009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101781 0039d316-1c4b-4281-b951-d872f2087c98
* Fix design shortcomings in Message classes.satorux@chromium.org2011-08-241-100/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Prohibit to instantiate Message class. Rationale: this is not corresponding to any D-Bus message types. - Get rid of Message::reset_raw_message() Rationale: this was breaking encapsulation. For instance, It was possible to inject a DBUS_MESSAGE_TYPE_ERROR raw message to a MethodCall message, which should not be allowed. - Prohibit to instantiate Response/ErrorResponse with NULL raw message. Rationale: Message objects should be backed up by valid raw messages. - Change Object::CallMethodAndBlock() to return Response*. Rationale: the original API requred a Response object with raw_message_ set to NULL, which we no longer allow. - Add message_type header to ToString(). BUG=90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7709009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97983 0039d316-1c4b-4281-b951-d872f2087c98
* Add support for sending and receiving D-Bus signals.satorux@chromium.org2011-08-231-0/+29
| | | | | | | | | | | | | | | | ObjectProxy is used to receive signals from the remote object. ExportedObject is used to send signals from the exported object. Note that signals are asynchronos so we don't have a test in end_to_end_sync_unittest.cc BUG=90036 TEST=run unit tests Review URL: http://codereview.chromium.org/7655033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97831 0039d316-1c4b-4281-b951-d872f2087c98
* Add AppendArrayOfObjectPaths, which was missing.satorux@chromium.org2011-08-221-0/+20
| | | | | | | | | | | It was an oversight not to have this function. BUG=90036 TEST=dbus_unittests Review URL: http://codereview.chromium.org/7686013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97689 0039d316-1c4b-4281-b951-d872f2087c98
* Fix typos in the message test.satorux@chromium.org2011-08-161-3/+3
| | | | | | | | | TEST=run dbus_unittests BUG=none Review URL: http://codereview.chromium.org/7669006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97055 0039d316-1c4b-4281-b951-d872f2087c98
* Add utility functions to Message classes.satorux@chromium.org2011-08-101-2/+88
| | | | | | | | | | | | | The new functions will be used to implement other classes that will be added in a separate patch. BUG=90036 TEST=run unit tests Review URL: http://codereview.chromium.org/7569020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96231 0039d316-1c4b-4281-b951-d872f2087c98
* Fix linux build breakrsleevi@chromium.org2011-07-301-3/+5
| | | | | | | | | | TBR=satorux@chromium.org BUG=none TEST=none Review URL: http://codereview.chromium.org/7453041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94846 0039d316-1c4b-4281-b951-d872f2087c98
* Implement classes used for manipulating D-Bus messages.satorux@chromium.org2011-07-301-0/+372
Message/MethodCall/Response classes wrap around DBusMessage. MessageReader and Message Writer provide API to read and write D-Bus messages in a type safe fashion. BUG=90036 TEST=The code is not yet used in Chrome. Run unit tests. Review URL: http://codereview.chromium.org/7492029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@94845 0039d316-1c4b-4281-b951-d872f2087c98