113 Commits

Author SHA1 Message Date
Eric Seidel
97ae8b44bd Add very basic support for symboled debugging on android
This only barely works.  We pull down system libraries
once before we attach.  The libraries we pull from
the device do not have debug symbols, but have enough
that we have decent callstacks.  We launch a background
process to repeatedly update a cache directory with
symlinks into our build directory corresponding to the cache
names used on the device, however gdb doesn't watch
the solib-search-path directories to notice the links
as we add them.

Better solutions would be to add support for pulling
down full android symboled system images and using those
instead of pulling libraries off the device as well as
figure out how to get android binaries to support
build-id so that we can present a directory of build-id
associated libraries to gdb on boot and have it to build-id
based lookups of libraries instead of our current broken
watch-logs-and-add-symlinks approach.

If you know what you're doing with this you can actually
make debugging work on the device.  It's not particularly
user friendly yet, but we'll work on it.

I added a build_dir member to skypy.paths.Paths
as a temporary measure before we move off of skypy's
paths and onto mopy's paths.  This helped eliminate
problems with using a relative path in args.build_dir
as is common.

R=abarth@chromium.org, ojan@chromium.org, qsr@chromium.org
BUG=

Review URL: https://codereview.chromium.org/855663003
2015-01-16 13:39:20 -08:00
Eric Seidel
74a45026ac Make --gdb work for android
This mostly works.  I haven't yet set up pulling down the
system binaries from the device to the host so that symbols
appear correctly, but I'll do that in the next patch.

One of the crazy things this patch adds it a script
to watch for loads on adb logcat and set up mappings
from the cache library names to the symboled binaries
in the out directory.  Presumably other scripts may
want to share this functionality so I've made it its
own script.

Better would be to have mojo_shell spit out a file
including the cache mapping information and we could
watch that file instead of logcat, but this works
for now.

R=qsr@chromium.org
BUG=

Review URL: https://codereview.chromium.org/848013004
2015-01-16 11:28:31 -08:00
Adam Barth
381a6d49e3 Add pprof support to skydb
After this CL, we're able to capture pprof profiles, but we're not quite able
to symbolize them properly.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/854833004
2015-01-15 16:34:16 -08:00
Adam Barth
48af5b3c8f Make tracing work on Android
Previously, the trace coordinator would try to write a trace to the file
system, but it is awkward to write to the file system on Android. Instead, we
now stream the trace data to a data pipe. The Sky debugger consumes that data
pipe and sends it to the host via the command HTTP server.

R=eseidel@chromium.org, jamesr@chromium.org

Review URL: https://codereview.chromium.org/853943005
2015-01-15 16:32:16 -08:00
Eric Seidel
5bca16603d Make skydb stop actually clear the pid file
TBR=abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/849053006
2015-01-14 16:29:09 -08:00
Tony Gentilcore
889bc4b2e6 Fix running skydb under chromoting.
Looks like a variable rename was missed.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/815143004
2015-01-13 18:50:52 -08:00
Eric Seidel
211b09bc3b Fix tools/android_stack_parser/stack and use it in skydb
This adds a skydb print_crash command which will dump the
symbolicated stack trace of all crashes found in adb logcat
output from the android device.

R=qsr@chromium.org

Review URL: https://codereview.chromium.org/787803006
2015-01-13 15:03:49 -08:00
Eric Seidel
84e63f80e7 Make skydb start url error out nicely
Both erg and abarth hit this lack-of-help this morning.

R=abarth@chromium.org, erg@chromium.org

Review URL: https://codereview.chromium.org/790793011
2015-01-13 13:18:10 -08:00
Eric Seidel
4b9b3110b3 Teach 'stop' command how to kill the running Android process
Also fixed --use-osmesa to be desktop only.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/849923002
2015-01-13 13:16:30 -08:00
Eric Seidel
c90d35c336 Make --gdb work again by using gdbserver
--gdb now starts gdbserver and I've added a new
command gdb_attach which knows how to launch gdb
and connect to the launched gdbserver

This doesn't quite work on android yet, but it's very close.

R=abarth@chromium.org, qsr@chromium.org
BUG=

Review URL: https://codereview.chromium.org/808053006
2015-01-13 12:16:30 -08:00
Hans Muller
cf522e3ed8 Mojo JS Bindings: add show_image example
Add a simple example based on the window and view managers.

The skydb app can now handle apps that want to embed another view.

Corrected a problem in unique module name generation. An otherwise unique module name could be shadowed by a parameter name (service_provider in ViewManagerService Embed). Appended a "$" suffix to module names to avoid the collision.

BUG=
R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/845103004
2015-01-12 16:35:35 -08:00
Eric Seidel
f9ca896516 Make --gdb explain that it doesn't work right now
I'm not quite sure how to solve this especially considering
android.  I likely should use 'gdbserve' but I was not able
to get that to work reliably.

At least this makes it less confusing that --gdb doesn't
just silently fail.

R=abarth@chromium.org, hansmuller@chromium.org, ojan@chromium.org
BUG=

Review URL: https://codereview.chromium.org/850533004
2015-01-12 15:17:40 -08:00
Eric Seidel
bd5c018fa4 Add skydb logcat command and make relative build_dir work
This fixes 3 little bugs in skydb:
1.  Adds a logcat command to make it easy to see android logs
2.  Fixes using relative build dirs in skydb start
3.  Stops sending /quit to debugger.cc since mojo shutdown
doesn't actually work (crashes).

--gdb is still broken, but I'll fix that in a second change.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/852483002
2015-01-12 15:12:07 -08:00
Eric Seidel
7647360840 Fix skydb to work for android
I changed skydb start to take a build directory
and read the configuration out of gn args instead
of --release, --debug, etc.  This should be more
flexable and handle all the crazy asan cases
mopy/config.py tries to.  Once we merge sky/tools
into mojo/tools we should make mopy/config use this
method too.

This follows similar patterns to what
mojo/tools/android_mojo_shell.py does, but doesn't
use as much of the (old) android_commands and forwarder
logic.  We could even remove all of that
build/android/pylib code by calling the (new)
adb reverse instead of using Forwarder (in a later patch).

This still only supports a single skydb running
at once, but it should be trivial to move the
skydb.pids file into the build directory or to have
it support more than one instance.  The big question
there is what the command-line usage should look like
when supporting more than one running instance.  See
the mojo-dev thread on the subject.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/816693006
2015-01-12 11:16:20 -08:00
Eric Seidel
a48f3d3893 Rewrite how skydb starts prompt.cc
This makes skydb pass a command_port to prompt.cc
as a commandline argument.  I removed passing of the
url and instead pass the url via a separate /load command.

This has the nice side effect of guarenteeing that
the sky instance is up and ready to respond to commands
when skydb exits.  It also prepares us for running
more than one copy of prompt.cc as jamesr requested
for both Release and Debug or for on both your android
device as well as your local machine.

R=abarth@chromium.org, jamesr@chromium.org
BUG=

Review URL: https://codereview.chromium.org/841113003
2015-01-08 15:50:09 -08:00
Eric Seidel
7eb8dccbb8 Exit with less stacktrace dump if we can't bind to the port
R=jamesr@chromium.org
BUG=

Review URL: https://codereview.chromium.org/843843003
2015-01-08 14:02:36 -08:00
Adam Barth
64a7d49358 Implement <sky-input>
This CL contains a basic input element.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/831353003
2015-01-08 13:22:00 -08:00
Eric Seidel
ec71469470 Make skydb just a ctl-style helper (e.g. apachectl)
This makes it much easier to work with a device where we
don't expect a persistent commandline session.  Prompt no longer
actually makes a prompt but rather just runs an http server.

This is just a v1 patch.  It doesn't work with android yet
and it isn't smart enough to allow you to run more than one
copy of prompt.cc at the same time (since you can't control
the port it listens on).  If you have a second copy of
prompt runnning (or anything else bound to port 7777) it will
just crash.

We could make this a lot better, including splitting out the
pid-file tracking for sky_server into sky_server instead of
having skydb manage it.

R=ojan@chromium.org, abarth@chromium.org
BUG=

Review URL: https://codereview.chromium.org/840973002
2015-01-08 13:01:15 -08:00
Hans Muller
cce5b826fd Mojo JS Bindings: merge Application, Shell, ServiceProvider with Sky
Enable Sky applications to be written in terms of the Application,
Shell, ServiceProvider classes.

Add a shellProxyHandle() method to the Sky Internals class. It returns
a message pipe handle that the JS Shell class will assume ownership of.

BUG=
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/837283002
2015-01-08 09:24:30 -08:00
Eric Seidel
3751008386 Make Sky not crash when run in MojoShell.apk
We'll fix both of these issues, but these hacks
unblock more important functionality fixes to
Sky run on Android.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/826063003
2015-01-06 17:38:34 -08:00
Ojan Vafai
926faea5c4 Minor improvements to reftests.
1. If notifyTestComplete is called before the first paint,
give a clear assert instead of a confusing crash.

2. Add runAfterDisplay. This is a copy of the equivalent
file in Blink. Avoids the incorrect 100ms setTimeout. I had
thought there was a deeper bug here, but it appears to just
be the issue from #1 now that we properly pump frames
in testing mode by using a face Surfaces application.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/826343003
2015-01-06 15:41:14 -08:00
Eric Seidel
1ff137055e Move wm_flow off of views and onto Sky
This is a proof of concept for replacing ui/views
code with Sky instead. erg says this will allow him
to delete 10s of thousands of LOC from mojo.

Mojo does not yet expose the current binary's URL:
https://docs.google.com/a/chromium.org/document/d/1AQ2y6ekzvbdaMF5WrUQmneyXJnke-MnYYL4Gz1AKDos
So I've worked around that by passing the url
of the binary via the helper script.

I discovered several bugs in the wm_flow code
including that it doesn't handle view resizes
(during embiggen).  Related, I discovered that
every time a new window is made it drops the
connections to the embedded.cc app from the
previous window, since the ViewManagerDelegate
is incorrectly implemented as part of the
ApplicationDelegate on both app.cc and embedded.cc.
We'd need to split out a separate per-view object
in both of those apps to handle the
ViewManagerDelegate calls.

There are some changes to logging during loading
as well as the CopyToFile helper to have better
error reporting.  I hit several issues early on trying
to get mojo to load the http: urls correctly, including
eventually running out of disk space on my /tmp
and mojo then silently failing to launch the app
(due to mojo never clearing its caches crbug.com/446302).

I had to re-write the mojo_demo.sh script in python
as well as split the sky_server handling code out of
skydb into a separate python module in order to cleanly
launch sky_server.  We could use a separate server
if we wanted to but the primary benefit of sky_server
is that it sets up the proper url->disk mappings into
the generated file directories, etc.

BUG=443439
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/817573003
2015-01-06 14:40:41 -08:00
James Robinson
01fa4d9893 Update from https://crrev.com/309717
Includes changes for CommandLine moving into the base:: namespace, some
PickleIterator updates, and some animation API changes.

Review URL: https://codereview.chromium.org/817653003
2014-12-29 14:41:55 -08:00
Scott Violet
bafedfb8f6 Moves Create() off of View and onto ViewManager
This makes more sense given the ViewManager is used to create the
view.

R=ben@chromium.org

Review URL: https://codereview.chromium.org/818583002
2014-12-19 07:45:16 -08:00
Scott Violet
17d7739f7c Nukes ViewManager arg from ViewManagerDelegate::OnEmbed
It can be obtained from the supplied view, so no reason to include in
the arguments.

R=ben@chromium.org, esprehn@chromium.org

Review URL: https://codereview.chromium.org/815003002
2014-12-18 14:35:42 -08:00
Eric Seidel
a9776838ee Add POST support to XHR as well as .status and statusText support
Also fixed all the XHR tests to actually run and work
I learned from elliot that the it function has to
take a "done" argument to be treated asynchronously.

My utf8 conversion is a hack, but we deleted
window.TextEncoder (it was a module) when we forked.
We could resurrect TextEncoder (and probably should)
but I've left that for a separate change.

I also augmented sky_server to have a special /echo_post
handler so we can test POST requests.

R=esprehn@chromium.org
BUG=

Committed: 5ef81d249b

Review URL: https://codereview.chromium.org/810523002
2014-12-16 11:20:40 -08:00
Eric Seidel
1fb39d65dd Revert "Add POST support to XHR as well as .status and statusText support"
This reverts commit 5ef81d249b841f44c9593ffb0158d64c7e0febfc.

This appeared to make 5 XHR tests timeout.  Not sure why yet.
TBR=esprehn@chromium.org

Review URL: https://codereview.chromium.org/808663002
2014-12-15 18:37:44 -08:00
Eric Seidel
6f33a75051 Add POST support to XHR as well as .status and statusText support
Also fixed all the XHR tests to actually run and work
I learned from elliot that the it function has to
take a "done" argument to be treated asynchronously.

My utf8 conversion is a hack, but we deleted
window.TextEncoder (it was a module) when we forked.
We could resurrect TextEncoder (and probably should)
but I've left that for a separate change.

I also augmented sky_server to have a special /echo_post
handler so we can test POST requests.

R=esprehn@chromium.org
BUG=

Review URL: https://codereview.chromium.org/810523002
2014-12-15 16:09:51 -08:00
James Robinson
d51de7b23a Add fake implementation of Surfaces service
BUG=
R=ojan@chromium.org

Review URL: https://codereview.chromium.org/804693002
2014-12-15 12:16:31 -08:00
Ojan Vafai
0fcf250d03 Make reftests work for sky.
-Add a --testing flag to sky_viewer and cause it to paint into an
SkBitmap instead of a ganesh surface so we can get the pixels out.
-Add GetPixelsForTesting to layer.cc to actually grab out the pixels.
-Add a reftest and a mismatch reftest. They need a setTimeout after
the load event. Unclear why or what the right fix is. Maybe we should
give internals some way to force the paint? If we don't have the
setTimeout, we paint a white page (so we do a paint, but with no
content).
-Add a DisplayDelegate to Layer so that Viewer can decide whether
to use the real ganesh backend or the SkBitmap one without littering
the whole code-base with is_testing bools and logic.

R=esprehn@chromium.org

Review URL: https://codereview.chromium.org/797063002
2014-12-12 16:45:49 -08:00
Ojan Vafai
f89114f222 Revert "Revert "Add image_diff from the chromium repo.""
This reverts commit 79d76b3da8f72ca3affaaaf2821b1d0bb212f522.

The BUILD.gn file needed a dep to //build/config/sanitizers:deps
in order to link under the asan build.

TBR=blundell@chromium.org

Review URL: https://codereview.chromium.org/804563002
2014-12-12 09:48:46 -08:00
Colin Blundell
7fb63ba1bd Revert "Add image_diff from the chromium repo."
This reverts commit ac5097e515ce8237ead2c89bc61dc914cb75313b.

Reason for revert:

Breaks compile on the ASan bot (e.g., http://build.chromium.org/p/client.mojo/builders/Mojo%20Linux%20ASan/builds/95/steps/mojob%20build/logs/stdio).

TBR=ojan

Review URL: https://codereview.chromium.org/800773002
2014-12-12 08:07:49 +01:00
Ojan Vafai
8971e980cd Prepare python code for reftests.
-s/-expected.html/-expected.sky/
-s/-expected-mismatch.html/-expected-mismatch.sky/
-In single_test_runner.py, get rid of the image hash checking
for reftests. It doesn't provide any value and just makes
getting reftests working more complicated.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/802573002
2014-12-11 15:24:02 -08:00
Ojan Vafai
63a8891e8d Add image_diff from the chromium repo.
This is needed for reference tests so we can diff images.
This is just a straight copy of the image diff in the
chromium repo.

R=eseidel@google.com, esprehn@chromium.org

Review URL: https://codereview.chromium.org/801443002
2014-12-11 15:21:29 -08:00
Colin Blundell
b5be4a0945 Restructure public side of navigation service.
This CL goes from this:
  //mojo/services/public/interfaces/navigation

to this:
  //mojo/services/navigation/public/interfaces

This CL also makes the Mojo-side changes necessary to roll this change into
Chromium.

TBR=beng

Review URL: https://codereview.chromium.org/796783002
2014-12-11 08:49:15 +01:00
Colin Blundell
ac99b9896f Restructure public side of input_events service.
This CL goes from this:
  //mojo/services/public/interfaces/input_events

to this:
  //mojo/services/input_events/public/interfaces

This CL also makes the Mojo-side changes necessary to roll this change into
Chromium.

TBR=beng

Review URL: https://codereview.chromium.org/788353002
2014-12-10 22:50:57 +01:00
Rafael Weinstein
f38f80c9f8 Enable/Unprefix Animations & Transitions, add basic tests
This patch remove the Web Animations & CSS Animation runtime flags (and enables both). Removes prefixed Aninamations & Transitions and adds some basic tests & test support API.

R=ojan@chromium.org

Review URL: https://codereview.chromium.org/760183003
2014-12-10 10:38:34 -08:00
Colin Blundell
3dc76a69df Restructure public side of view_manager service.
This CL goes from this:
//mojo/services/public/cpp/view_manager
//mojo/services/public/interfaces/view_manager

to this:
//mojo/services/view_manager/public/cpp
//mojo/services/view_manager/public/interfaces

This CL also makes the Mojo-side changes required to roll this change into
Chromium (for both view_manager and window_manager, which was converted in an
earlier CL but for which these updates were not made):
- Updates rev_sdk.py to pull over the new directory
- Updates //mojo/services/public/mojo_services_public.gyp

TBR=beng

Review URL: https://codereview.chromium.org/790623003
2014-12-10 14:16:27 +01:00
Ojan Vafai
c37e637852 Run sky tests more parallelized.
Now that we're off cherrypy, hopefully we can run more tests
in parallel without timeouts. This works well for me locally.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/786833002
2014-12-08 12:46:49 -08:00
James Robinson
29235bd8a2 Put code in //services/window_manager in namespace window_manager
R=sky@chromium.org

Review URL: https://codereview.chromium.org/788453002
2014-12-08 12:08:55 -08:00
Ojan Vafai
db877ecf4f Green sky tests on the asan bot.
Skipped tests were not getting skipped because
the code gets whether the build is a debug or release
build from the configuration commandline argument, but
the asan bots pass Release_asan. Instead, read the
debug vs. release state from gn args instead of inferring
it from the out directory.

R=eseidel@chromium.org, esprehn@chromium.org, sky@chromium.org

Review URL: https://codereview.chromium.org/754673003
2014-12-08 11:15:13 -08:00
Ojan Vafai
dd1ee1ade5 Change test_sky to use the buildbot step name as the testtype.
This should make the flakiness dashboard work again.

TBR=eseidel@chromium.org

Review URL: https://codereview.chromium.org/780993002
2014-12-04 16:25:13 -08:00
Ojan Vafai
61d78bd869 Convert sky_server over to a go-based http server.
We keep seeing timeouts on the bots that seem to be due
to cherrypy dropping requests on the floor, which in turn
causes imports to stall, which causes the test to time out.
In local testing, I was able to reproduce the timeouts
and wasn't able to do so with the go-based server.

R=abarth@chromium.org, eseidel@chromium.org

Review URL: https://codereview.chromium.org/746373002
2014-12-04 16:10:09 -08:00
James Robinson
f6527512b0 Simplify the thunk targets since we don't support apps as components
Since we don't support using the component build to produce mojo apps,
we can simplify the build targets in a few ways:

*) every mojo_native_application must depend on the c system thunks,
so just make that part of the template instead of requiring the dep
*) there's no such thing as depending on gles2 headers from a component,
so delete the forwarding group.

Most targets that want to use the gles2 headers in a mojo context
want to depend on an implementation through the thunks, so
//mojo/public/c/gles2 does just that. A smaller number of targets (such
as the implementation of the thunks) want to just depend on the headers
but not an impl, so they can depend on //mojo/public/c/gles2:headers.
The //mojo/public/gles target isn't that useful since the only thing we
expose is a set of C entry points.

We can probably also simplify the c system targets, but that's trickier
due to more extensive use from the chromium side.

BUG=438701
R=viettrungluu@chromium.org

Review URL: https://codereview.chromium.org/780733002
2014-12-03 16:25:09 -08:00
James Robinson
685a549229 Move window_manager service implementation to //services
R=erg@chromium.org

Review URL: https://codereview.chromium.org/765753003
2014-12-02 10:52:00 -08:00
James Robinson
84690ebeab Add tracing service and make the shell+sky_viewer+services talk to it
This adds a tracing service that can aggregate tracing data from
multiple sources and write a json file out to disk that trace-viewer can
understand. This also teaches the shell, sky_viewer, and various other
services how to register themselves with the tracing service and provide
tracing data on demand. Finally, this teaches the skydb prompt to tell
the tracing service to start/stop tracing when the 'trace' command is
issued.

The tracing service exposes two APIs, a collector interface and a
coordinator interface. The collector interface allows different entities
to register themselves as being capable of producing tracing data. The
coordinator interface allows asking the service to collect data from
all registered sources and flushing the collected data to disk.

The service keeps track of all open connections to registered sources
and broadcasts a request for data whenever the coordinator's Start
method is called, then aggregates all data send back into a single
trace file. In this patch, the tracing service simply gives all sources
1 second to return data then flushes to disk. Ideally it would keep
track of how many requests it sent out and give each source a certain
amount of time to respond but this is simple and works for most cases.

The tracing service can talk to any source that is capable of producing
data that the trace-viewer can handle, which is a broad set, but in
practice many programs will want to use //base/debug's tracing to
produce trace data. This adds code at //mojo/common:tracing_impl that
registers a collector hooked up to //base/debug's tracing system. This
can be dropped in to the mojo::ApplicationDelegate::Initialize()
implementation for most services and applications to easily enable
base tracing. Programs that don't use //base, or that want to register
additional data sources that can talk to trace viewer (perhaps providing
data that's more easily available from another thread, say) may want
to create additional connections to the tracing service.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/769963004
2014-12-01 16:31:03 -08:00
Ojan Vafai
1826b1a6fd Undo quoting from c86b07f409c4698eccf5042ee1985f13971aaabb.
Turns out it breaks the popen call and doesn't pass
the right thing. :(

TBR=abarth@chromium.org

Review URL: https://codereview.chromium.org/766613002
2014-11-26 17:00:20 -08:00
Ojan Vafai
759c4387ac Fix test_sky commandline printing.
1. Print out the sky_server commandline as well so it's easy
to run the server without running test_sky.
2. Quote the --args-for arguments, so that they copy-paste
correctly.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/762703005
2014-11-26 16:24:08 -08:00
Adam Barth
ead67ecbbf Remove event targeting hack
Mojo's event targeting system has evolved to the point were we don't need this
ugly hack anymore.

R=ojan@chromium.org, erg@chromium.org

Review URL: https://codereview.chromium.org/762443002
2014-11-26 09:00:04 -08:00
James Robinson
973bb96d11 Move tracing_impl code to mojo/common
This moves the tracing code and mojoms from sky/viewer/services/ to
mojo/common/ in anticipation of refactoring these to be more widely
usable. This doesn't actually change behaviors yet.

BUG=436639
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/751303003
2014-11-25 16:23:42 -08:00