summaryrefslogtreecommitdiffstats
path: root/mojo/public/tests
Commit message (Collapse)AuthorAgeFilesLines
* Mojo: re-organize public/bindings/ directorydarin@chromium.org2014-01-2812-1470/+0
| | | | | | | | | | | | | | | | | | | The plan: - mojo/public/{subdir} contains public headers and scripts (if any). - mojo/public/{subdir}/lib contains private headers and .cc files (if any). - mojo/public/{subdir}/tests contains test files. This CL only implements the plan for the public/bindings/ directory. Other directories will follow. In addition, bindings header files are broken up a bit. In particular, buffer.{h,cc} are carved up so that buffer.h can only contain public bits. This necessitates creation of allocation_scope.h. I extracted type_converter.h instead of letting it be buried inside array_internal.h. This CL nukes bindings/sample/. R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/141703007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247409 0039d316-1c4b-4281-b951-d872f2087c98
* Support default values for arrays of POD data types in mojom.mpcomplete@chromium.org2014-01-242-1/+5
| | | | | | | | | | TODO: defaults values for structs BUG=320082 Review URL: https://codereview.chromium.org/141893004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246994 0039d316-1c4b-4281-b951-d872f2087c98
* Support default values for POD struct fields in mojom IDL.mpcomplete@chromium.org2014-01-222-3/+17
| | | | | | | | | | TODO: default values for arrays and structs. BUG=320082 Review URL: https://codereview.chromium.org/138143003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246424 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Make C API test work on MSVS before 2013.viettrungluu@chromium.org2014-01-221-11/+14
| | | | | | | | R=davemoore@chromium.org Review URL: https://codereview.chromium.org/136363004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@246183 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Actually test some APIs in C (not C++).viettrungluu@chromium.org2014-01-182-0/+94
| | | | | | | | | | Also fix some problems in our C declarations/defines. R=sky@chromium.org Review URL: https://codereview.chromium.org/136793027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245668 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Add test for C++ mojo::MessagePipe wrapper.viettrungluu@chromium.org2014-01-171-17/+17
| | | | | | | | R=sky@chromium.org Review URL: https://codereview.chromium.org/141973003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245607 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: foo_[0-9] -> foo[0-9].viettrungluu@chromium.org2014-01-173-173/+171
| | | | | | | | | | For foolish consistency. I'll never make this mistake again. R=sky@chromium.org Review URL: https://codereview.chromium.org/140503005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245573 0039d316-1c4b-4281-b951-d872f2087c98
* Normalize _unittest.cc filename suffix for unittestsalecflett@chromium.org2014-01-171-1/+1
| | | | | | | | | | | This allows tools that use filename heuristics to detect tests (like scythe) BUG=335193 Review URL: https://codereview.chromium.org/138433004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245392 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Make mojo/public/tests/test_support.cc not depend on base/time.h.viettrungluu@chromium.org2014-01-161-7/+7
| | | | | | | | | | | Still left: base/test/perf_log.h, which will probably require support from the embedder somehow. R=darin@chromium.org Review URL: https://codereview.chromium.org/132873004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@245027 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Remove some base/ dependencies from mojo/public/tests/.viettrungluu@chromium.org2014-01-154-84/+82
| | | | | | | | | | | | | | mojo/public/tests/ shouldn't depend on stuff outside of public/. (Still left to do: a couple dependencies in test_support.cc.) R=darin@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=244966 Review URL: https://codereview.chromium.org/139843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244977 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 244966 "Mojo: Remove some base/ dependencies from mojo/pu..."pauljensen@chromium.org2014-01-154-79/+81
| | | | | | | | | | | | | | | | | | | | Failed to build: http://build.chromium.org/p/chromium/builders/Linux/builds/46631 > Mojo: Remove some base/ dependencies from mojo/public/tests/. > > mojo/public/tests/ shouldn't depend on stuff outside of public/. > > (Still left to do: a couple dependencies in test_support.cc.) > > R=darin@chromium.org > > Review URL: https://codereview.chromium.org/139843002 TBR=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/136033006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244971 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Remove some base/ dependencies from mojo/public/tests/.viettrungluu@chromium.org2014-01-154-81/+79
| | | | | | | | | | | | mojo/public/tests/ shouldn't depend on stuff outside of public/. (Still left to do: a couple dependencies in test_support.cc.) R=darin@chromium.org Review URL: https://codereview.chromium.org/139843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244966 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: AsyncWaiter and mojo/public/environmentdarin@chromium.org2014-01-1410-202/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary of changes: o BindingsSupport is gone: - mojo/public/bindings/lib depends on mojo/public/environment/, which is also a static library. - mojo/public/environment provides a default implementation of MojoAsyncWaiter (replacing the AsyncWait functionality of BindingsSupport). - mojo/public/environment provides TLS support for storing the current Buffer* (replacing the Set/GetCurrentBuffer functionality of BindingsSupport). - mojo/public/environment provides the Environment class, formerly part of mojo/public/utility/ - The standalone implementation of mojo/public/environment/ depends on mojo/public/utility/ and assumes clients will be instantiating RunLoops on their threads. - The chromium-specific implementation of mojo/public/environment/ depends on mojo/common/ and assumes clients will be instantiating MessageLoops on their threads. - The chromium-specific implementation of mojo/public/environment/ is divided into two targets: mojo_environment_chromium and mojo_environment_chromium_impl. The former is a static library and the latter is a component. (This way all of the state--TLS keys-- associated with the environment is kept in a DSO when using a component build.) o RemotePtr and Connector may optionally be parameterized with a MojoAsyncWaiter*, allowing users to customize how AsyncWait is implemented for a particular usage of bindings. This is needed by the GL library so that it can schedule work on an application defined run loop. o RunLoop gains a RunUntilIdle method to support tests. This allows us to delete SimpleBindingsSupport instead of converting it over to an implementation of MojoAsyncWaiter. Review URL: https://codereview.chromium.org/134253004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244739 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: re-organize public testsdarin@chromium.org2014-01-1222-54/+896
| | | | | | | | | | Move sample service test to be with the rest of the bindings tests, and change it to not echo output by default. R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/134823005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244437 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: abstract interface implementation from generated Stub classesdarin@chromium.org2014-01-072-14/+10
| | | | | | | | | | Remove RemotePtr<S>::SetPeer method in favor of an optionally NULL second constructor argument. (The reset method also gains an optionally NULL second argument.) R=davemoore@chromium.org Review URL: https://codereview.chromium.org/109103003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@243416 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Change use of "not found" to more explicit "should wait".viettrungluu@chromium.org2014-01-043-3/+3
| | | | | | | | | | (Add a "should wait" error code.) R=darin@chromium.org Review URL: https://codereview.chromium.org/122983004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242976 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Add MessagePipe to core_cpp.h for conveniencedarin@chromium.org2013-12-252-17/+0
| | | | | | Review URL: https://codereview.chromium.org/119563003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@242484 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Basic C++ wrappers for the (still-untested) data pipes.viettrungluu@chromium.org2013-12-171-0/+2
| | | | | | | | | | I'd write tests, but I want to start from the "bottom up". R=sky@chromium.org Review URL: https://codereview.chromium.org/114813007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@241419 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Minor core.h reorganization.viettrungluu@chromium.org2013-12-122-12/+12
| | | | | | | | | | | Move time ticks stuff to be first. I'm trying to keep things in order starting from simplest/most essential. R=sky@chromium.org Review URL: https://codereview.chromium.org/101513005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240223 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Support passing invalid handlesdarin@chromium.org2013-12-101-18/+53
| | | | | | | | BUG=327263 Review URL: https://codereview.chromium.org/100073005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239892 0039d316-1c4b-4281-b951-d872f2087c98
* Creates a trivial mojo RunLoop along with BindingSupport on top of itsky@chromium.org2013-12-102-0/+30
| | | | | | | | | | | | | | The RunLoop doesn't support nesting. I also had to cut a few corners for TLS, in particular I didn't want to drag in LazyInstance as that pulls in quite a few other headers. BUG=none TEST=none R=darin@chromium.org Review URL: https://codereview.chromium.org/107263002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239696 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Array operator[] for handles.darin@chromium.org2013-12-101-3/+28
| | | | | | | | | | As part of this CL, Array bits are moved out into separate "array"-prefix files. R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/107423003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239687 0039d316-1c4b-4281-b951-d872f2087c98
* Make handle getters return a Slot<{MessagePipe}Handle> instead.darin@chromium.org2013-12-081-0/+12
| | | | | | | | R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/104433007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239394 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: SimilarityTraits -> TypeConverterdarin@chromium.org2013-12-081-12/+12
| | | | | | | | | | Also Copy{From,To} -> Convert{From,To}. R=abarth@chromium.org Review URL: https://codereview.chromium.org/101743003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239379 0039d316-1c4b-4281-b951-d872f2087c98
* Added specialization for bool Array which packs each element into a single bit.darin@chromium.org2013-12-071-0/+59
| | | | | | | | | | Included some simple tests. R=darin@chromium.org Review URL: https://codereview.chromium.org/76963002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239330 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Expose error state from Connector through RemotePtrdarin@chromium.org2013-12-072-8/+39
| | | | | | | | | | (This is part 1 of adding better error handling to the bindings system.) BUG=325321 Review URL: https://codereview.chromium.org/105693005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@239305 0039d316-1c4b-4281-b951-d872f2087c98
* Adds MojoGetTimeTicks to mojosky@chromium.org2013-12-052-0/+12
| | | | | | | | | BUG=none TEST=none Review URL: https://codereview.chromium.org/103653002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238849 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Add move semantics to RemotePtr<T>darin@chromium.org2013-12-042-11/+43
| | | | | | | | | | | Also, put Connector into the mojo::internal:: namespace. BUG=325806 R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/103193004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238814 0039d316-1c4b-4281-b951-d872f2087c98
* Add array bounds assertion and improve type conversion for empty strings.darin@chromium.org2013-12-041-0/+14
| | | | | | | | | BUG=324829 R=abarth@chromium.org Review URL: https://codereview.chromium.org/105133002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238751 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Generate bindings that make use of ScopedMessagePipeHandle.darin@chromium.org2013-12-045-0/+213
| | | | | | | | R=abarth@chromium.org, davemoore@google.com, viettrungluu@chromium.org Review URL: https://codereview.chromium.org/97713002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238592 0039d316-1c4b-4281-b951-d872f2087c98
* Remove "ScopedHandleBase<H>::operator H() const"darin@chromium.org2013-12-031-21/+25
| | | | | | | | | | Reason: it is too easy to misuse this and end up leaking a handle. R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/99913002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238252 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Add support for converting between mojo::String and base::StringPiece.darin@chromium.org2013-12-021-1/+15
| | | | | | | | | | | | | | | | | | This CL also adds an implicit conversion operator to type U that works just like an explicit call to To<U>. This is to go along with the implicit conversion constructors on mojo::Array and generated class types. While discouraged by the style guide, I think this kind of implicit conversion will be very helpful at reducing code verbosity. It shouldn't be too dangerous either. Finally, I took this opportunity to de-inline specializations of SimilarityTraits where possible. BUG=324594 Review URL: https://codereview.chromium.org/98313002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238085 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: SimilarityTraitsdarin@chromium.org2013-12-012-0/+224
| | | | | | | | Make it possible for users to extend the set of types that can be converted to or from a mojo::Array<T> (including mojo::String) or any generated struct. Review URL: https://codereview.chromium.org/62333020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237993 0039d316-1c4b-4281-b951-d872f2087c98
* Buffer may optionally be found through TLS.darin@chromium.org2013-11-283-4/+49
| | | | | | | | | BUG=320105 R=davemoore@chromium.org Review URL: https://codereview.chromium.org/82913002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237684 0039d316-1c4b-4281-b951-d872f2087c98
* Use ScopedMessagePipeHande in Connector.davemoore@chromium.org2013-11-272-21/+25
| | | | | | | | | | | | This is the first step in moving the bindings entirely to ScopedMessagePipeHandle BUG=None R=viettrungluu@chromium.org, viettrungluu Review URL: https://codereview.chromium.org/89003003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237577 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Fix MessagePipe teardown when it has enqueued messages.viettrungluu@chromium.org2013-11-261-2/+96
| | | | | | | | | | | | | | | | | | | | In particular, when an enqueued message has a "handle"/Dispatcher -- that Dispatcher needs to be Close()d. This is a little touchy, since we'll be acquiring a Dispatcher lock under another MessagePipeDispatcher's lock. But this case is okay since we should have the only references to Dispatchers in our message queue (and so those locks should never be acquired). TODO: Instead, maybe add a "frozen" state to Dispatchers, and have CreateEquivalentDispatcherAndCloseNoLock() create Dispatchers in that state, with the Dispatchers being "thawed" when read from a message. (Then Dispatcher destructors could auto-close if still "frozen".) R=darin@chromium.org, darin Review URL: https://codereview.chromium.org/85163005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237350 0039d316-1c4b-4281-b951-d872f2087c98
* Have ScratchBuffer::Allocate prefer allocating on the stack even if a previousmpcomplete@chromium.org2013-11-211-2/+1
| | | | | | | | allocation required the heap. Review URL: https://codereview.chromium.org/76943002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236389 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Improved C++ wrappers.viettrungluu@chromium.org2013-11-217-88/+362
| | | | | | | | | | | | | | | | | | | | | | | These build in some stronger static typing and try to help with lifetime management. They remain true to the C API (using functions instead of methods), to be consistent and avoid awkwardness between the Handle objects and their scoped versions (e.g., if we put methods on MessagePipeHandle, it'd be awkward to access them from the scoped version). Also, they are written with code generators in mind. As such, currently I only provide WriteMessageRaw()/ReadMessageRaw() that a) provide full access to the C API, and b) don't help with lifetime management (but also don't impose any further efficiency issues either). I'd consider adding non-raw versions, but the intention is that most people would use generated proxy code (which may take, e.g., MessagePipeHandle or ScopedMessagePipeHandle arguments). R=abarth@chromium.org, darin@chromium.org Review URL: https://codereview.chromium.org/71613005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236357 0039d316-1c4b-4281-b951-d872f2087c98
* Add some unit tests for mojo's Buffer classes.mpcomplete@chromium.org2013-11-201-0/+87
| | | | | | Review URL: https://codereview.chromium.org/67683004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236158 0039d316-1c4b-4281-b951-d872f2087c98
* Enable and fix BindingsConnectorTest.MessageWithHandlesdavemoore@chromium.org2013-11-191-8/+21
| | | | | | | | | | BUG=None TEST=Enabled R=darin Review URL: https://codereview.chromium.org/76393002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236030 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Generate bindings from math_calculator.mojom.darin@chromium.org2013-11-185-468/+1
| | | | | | Review URL: https://codereview.chromium.org/68683010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235806 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Trivial cleanup -- remove unneeded test fixture in test.viettrungluu@chromium.org2013-11-141-4/+1
| | | | | | | | R=sky@chromium.org, sky Review URL: https://codereview.chromium.org/73243002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235255 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Add a MOJO_ARRAYSIZE, corresponding to Chromium's arraysize.viettrungluu@chromium.org2013-11-141-2/+2
| | | | | | | | | | | (Like the other things in the file, so that mojo/public doesn't have to depend on base.) R=darin@chromium.org, davemoore Review URL: https://codereview.chromium.org/70273009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235166 0039d316-1c4b-4281-b951-d872f2087c98
* Fix win64 build failures on size truncationjschuh@chromium.org2013-11-131-1/+1
| | | | | | | | R=viettrungluu@chromium.org Review URL: https://codereview.chromium.org/64623003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234731 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: RemotePtr<S> + bindings changes for Peer attribute.darin@chromium.org2013-11-137-18/+625
| | | | | | | | This adds an end-to-end test of the system w/ generated code as part of the CL. The generated code can be deleted once we have a GYP rule for generating code. Review URL: https://codereview.chromium.org/66353002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234681 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Add BindingsSupportImpl on top of HandleWatcher (take 2)darin@chromium.org2013-11-122-28/+32
| | | | | | | | | | | | | | Plumb MojoResult to the callback set on HandleWatcher. Revise BindingsSupport interface to make the implementation on top of HandleWatcher trivial. Originally reviewed at https://codereview.chromium.org/62773003/. Includes fix to mojo.gyp to make libmojo_shell link against mojo_common_lib on Android. R=sky@chromium.org Review URL: https://codereview.chromium.org/69633002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234408 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Make bindings_connector_unittest.cc not depend on base.viettrungluu@chromium.org2013-11-111-6/+5
| | | | | | | | R=darin@chromium.org, darin Review URL: https://codereview.chromium.org/68973006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234332 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Make tests under mojo/public use our own run_all_unittests.cc.viettrungluu@chromium.org2013-11-115-26/+7
| | | | | | | | | | | | | | | Split off run_all_unittests.cc to its own static library and make the various test targets under mojo/public depend on that. This way they don't have to call CoreImpl::Init() themselves. Also temporarily disable public/bindings/sample/sample_test.cc until I convert it to a gtest, which I'll do separately. R=sky@chromium.org, sky Review URL: https://codereview.chromium.org/68203005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234280 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Mojo: Add BindingsSupportImpl on top of HandleWatcher"darin@chromium.org2013-11-112-32/+28
| | | | | | Review URL: https://codereview.chromium.org/69283002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234252 0039d316-1c4b-4281-b951-d872f2087c98
* Mojo: Add BindingsSupportImpl on top of HandleWatcherdarin@chromium.org2013-11-112-28/+32
| | | | | | | | | | Plumb MojoResult to the callback set on HandleWatcher. Revise BindingsSupport interface to make the implementation on top of HandleWatcher trivial. R=sky@chromium.org Review URL: https://codereview.chromium.org/62773003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@234247 0039d316-1c4b-4281-b951-d872f2087c98