New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 648701 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Bug



Sign in to add a comment

devtools support for mus

Project Member Reported by sadrul@chromium.org, Sep 20 2016

Issue description

We want to be able to inspect mus window server using the chrome devtools frontend.

The initial implementation should be to just explore the window tree (which gets updated as needed), with a set of interesting window attributes. It may make sense to eventually allow editing the window tree (e.g. change window attributes, deleting windows, etc.) from the front-end as well.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Sep 27 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fb4bbebb606d40493cdc89baecb7139c6b7c8be4

commit fb4bbebb606d40493cdc89baecb7139c6b7c8be4
Author: mhashmi <mhashmi@chromium.org>
Date: Tue Sep 27 15:44:32 2016

Make backend destructor public

This allows Backend pointers to point to derived classes.

BUG=648701

Review-Url: https://codereview.chromium.org/2365283003
Cr-Commit-Position: refs/heads/master@{#421221}

[modify] https://crrev.com/fb4bbebb606d40493cdc89baecb7139c6b7c8be4/third_party/WebKit/Source/platform/inspector_protocol/templates/TypeBuilder_h.template

Project Member

Comment 2 by bugdroid1@chromium.org, Oct 25 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9

commit 1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9
Author: mhashmi <mhashmi@chromium.org>
Date: Tue Oct 25 22:13:34 2016

Add ui devtools server

Implement a basic devtools server for mus/ash in order to inspect the window
server tree hierarchy from a chrome devtools client. This can be enabled
by starting chrome with the flag --enable-ui-devtools=<port>.
With this implementation, a basic server that only communicates with web
sockets is started. It responds with the hierarchy when the devtools
client connects.

BUG=648701
CQ-DEPEND=CL:2365283003

Review-Url: https://codereview.chromium.org/2374513002
Cr-Commit-Position: refs/heads/master@{#427506}

[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/BUILD.gn
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/DEPS
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/OWNERS
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/devtools_client.cc
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/devtools_client.h
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/devtools_server.cc
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/devtools_server.h
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/inspector_protocol_config.json
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/protocol.json
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/protocol_platform.h
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/string_util.cc
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/string_util.h
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/switches.cc
[add] https://crrev.com/1ec338a7f29b26c0e6ae4c5c276d6014e00b77c9/components/ui_devtools/switches.h

Project Member

Comment 4 by bugdroid1@chromium.org, Oct 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e2445fe73810b097225b9ed1caedafe0251a2120

commit e2445fe73810b097225b9ed1caedafe0251a2120
Author: mhashmi <mhashmi@chromium.org>
Date: Sat Oct 29 20:46:32 2016

Create a base agent class for ui_devtools

Each ui component such as ash, must create its own agents that implement
various backends (such as DOM or CSS). Each agent must be wired to the
main dispatcher so that it can receive events. In addition, each agent
must have access to a FrontendChannel instance so that it can push
updates to the inspector. This change creates a base agent which
abstracts out all of this. Any agent, like a DOM or CSS agent simply
inherit from this class and whenever they are attached to the
UiDevToolsClient, they are then initialized. This means they are
wired up and the FrontendChannel instance is set with the dispatcher
available from UiDevToolsClient.

This is what DevTools does for their agents, and this CL implements
a simpler version of that.

BUG=648701

Review-Url: https://codereview.chromium.org/2456643002
Cr-Commit-Position: refs/heads/master@{#428615}

[modify] https://crrev.com/e2445fe73810b097225b9ed1caedafe0251a2120/components/ui_devtools/BUILD.gn
[add] https://crrev.com/e2445fe73810b097225b9ed1caedafe0251a2120/components/ui_devtools/devtools_base_agent.h
[modify] https://crrev.com/e2445fe73810b097225b9ed1caedafe0251a2120/components/ui_devtools/devtools_client.cc
[modify] https://crrev.com/e2445fe73810b097225b9ed1caedafe0251a2120/components/ui_devtools/devtools_client.h

Project Member

Comment 5 by bugdroid1@chromium.org, Oct 31 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6011c1bd16ebebe75c97cdfed9849b8d14197a6e

commit 6011c1bd16ebebe75c97cdfed9849b8d14197a6e
Author: mhashmi <mhashmi@chromium.org>
Date: Mon Oct 31 15:24:29 2016

Pass task_runner_ to server and send 404 when incorrect url

A few small changes for the ui_devtools server:
- Don't create a new thread and just pass a task_runner_.
- Send 404 when invalid url is requested from the server.
- Fix for weird error where HttpServer calls OnClose with a connection
id that never even connected in the first place. Just do nothing if
the connection id doesn't exist in our list of connections connected to
a UI client.

BUG=648701

Review-Url: https://codereview.chromium.org/2455833002
Cr-Commit-Position: refs/heads/master@{#428713}

[modify] https://crrev.com/6011c1bd16ebebe75c97cdfed9849b8d14197a6e/ash/common/wm_shell.cc
[modify] https://crrev.com/6011c1bd16ebebe75c97cdfed9849b8d14197a6e/components/ui_devtools/devtools_server.cc
[modify] https://crrev.com/6011c1bd16ebebe75c97cdfed9849b8d14197a6e/components/ui_devtools/devtools_server.h

Components: Internals>MUS Platform>DevTools
Labels: Proj-Mustash-Milestone-Tadpole
Project Member

Comment 8 by bugdroid1@chromium.org, Nov 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/61f8685225e0e823b0121b1f2adabcbda9df8387

commit 61f8685225e0e823b0121b1f2adabcbda9df8387
Author: mhashmi <mhashmi@chromium.org>
Date: Thu Nov 03 14:43:57 2016

Add test for ash devtools DOM agent getDocument method

Added a test to make sure correct DOM hierarchy is built
and added helper methods to compare windows, widgets and views to DOM nodes.

BUG=648701

Review-Url: https://codereview.chromium.org/2469883002
Cr-Commit-Position: refs/heads/master@{#429580}

[modify] https://crrev.com/61f8685225e0e823b0121b1f2adabcbda9df8387/ash/BUILD.gn
[modify] https://crrev.com/61f8685225e0e823b0121b1f2adabcbda9df8387/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/61f8685225e0e823b0121b1f2adabcbda9df8387/ash/common/devtools/ash_devtools_dom_agent.h
[add] https://crrev.com/61f8685225e0e823b0121b1f2adabcbda9df8387/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Nov 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ca5eebc52d4de0237b911dbd9ec9808a6735b050

commit ca5eebc52d4de0237b911dbd9ec9808a6735b050
Author: mhashmi <mhashmi@chromium.org>
Date: Thu Nov 03 15:17:45 2016

Disable agents when client disconnects

Create a Disable method for the UiDevToolsAgent which calls the disable
method on agent that subclasses from generated backends. This is then
called from the UiDevToolsClient, which in turn has a DisableAllAgents
method called by the UiDevToolsServer when a client disconnects from
the inspector.

BUG=648701

Review-Url: https://codereview.chromium.org/2470933002
Cr-Commit-Position: refs/heads/master@{#429591}

[modify] https://crrev.com/ca5eebc52d4de0237b911dbd9ec9808a6735b050/components/ui_devtools/devtools_base_agent.h
[modify] https://crrev.com/ca5eebc52d4de0237b911dbd9ec9808a6735b050/components/ui_devtools/devtools_client.cc
[modify] https://crrev.com/ca5eebc52d4de0237b911dbd9ec9808a6735b050/components/ui_devtools/devtools_client.h
[modify] https://crrev.com/ca5eebc52d4de0237b911dbd9ec9808a6735b050/components/ui_devtools/devtools_server.cc

Project Member

Comment 10 by bugdroid1@chromium.org, Nov 5 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/584115bcc2a6724daf09482a199ddb179f1a9cc2

commit 584115bcc2a6724daf09482a199ddb179f1a9cc2
Author: mhashmi <mhashmi@chromium.org>
Date: Sat Nov 05 00:50:03 2016

Push updates to inspector when windows are added, destroyed or reorganized

This CL pushes updates to the connected DevTools inspector whenever windows
are updated in any way. We add the DOM agent as an observer to the root
window and simply listen for any window tree changes. Depending on whether
there is a new parent or an old parent for the target window, we push
updates for removing and adding the window DOM node.

This adds two events to the protocol: childNodeInserted and childNodeRemoved.

BUG=648701

Review-Url: https://codereview.chromium.org/2466073003
Cr-Commit-Position: refs/heads/master@{#430102}

[modify] https://crrev.com/584115bcc2a6724daf09482a199ddb179f1a9cc2/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/584115bcc2a6724daf09482a199ddb179f1a9cc2/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/584115bcc2a6724daf09482a199ddb179f1a9cc2/ash/common/devtools/ash_devtools_unittest.cc
[modify] https://crrev.com/584115bcc2a6724daf09482a199ddb179f1a9cc2/components/ui_devtools/protocol.json

Project Member

Comment 11 by bugdroid1@chromium.org, Nov 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f6541e95f3d06008a83f38fbfe77559448bdf985

commit f6541e95f3d06008a83f38fbfe77559448bdf985
Author: mhashmi <mhashmi@chromium.org>
Date: Fri Nov 11 01:25:23 2016

Add UI_DEVTOOLS_EXPORT so tests can mock FrontendChannel

This change adds the UI_DEVTOOLS_EXPORT macro to the generated devtools
files. This is mainly so that FrontendChannel and UberDispatcher classes
are exposed to unit tests.

BUG=648701

Review-Url: https://codereview.chromium.org/2468263006
Cr-Commit-Position: refs/heads/master@{#431442}

[modify] https://crrev.com/f6541e95f3d06008a83f38fbfe77559448bdf985/components/ui_devtools/BUILD.gn
[add] https://crrev.com/f6541e95f3d06008a83f38fbfe77559448bdf985/components/ui_devtools/devtools_export.h
[modify] https://crrev.com/f6541e95f3d06008a83f38fbfe77559448bdf985/components/ui_devtools/inspector_protocol_config.json

Project Member

Comment 12 by bugdroid1@chromium.org, Nov 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/90cb9ea6f9d7605422477edf45a4a1f54de1beea

commit 90cb9ea6f9d7605422477edf45a4a1f54de1beea
Author: mhashmi <mhashmi@chromium.org>
Date: Fri Nov 11 01:55:06 2016

Add tests for ash devtools window updates

Add tests for when a window is added, removed, reorganized and when a
stacking change occurs.

BUG=648701

Review-Url: https://codereview.chromium.org/2480683003
Cr-Commit-Position: refs/heads/master@{#431454}

[modify] https://crrev.com/90cb9ea6f9d7605422477edf45a4a1f54de1beea/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 13 by bugdroid1@chromium.org, Nov 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/810a7a208ae6566e497fd3412b3a6da885234d0a

commit 810a7a208ae6566e497fd3412b3a6da885234d0a
Author: mhashmi <mhashmi@chromium.org>
Date: Fri Nov 11 02:34:48 2016

Update ash DOM agent so that widgets are direct children of windows

Small bug that caused widgets to be the siblings of their parent windows.
This fixes that by adding any widgets as the direct descendents of their
parent windows. In addition, modified the tests so that they compare
all windows to nodes. Removed the widget finding method as they can
now be queried directly from the window nodes (first child should be
the widget).

BUG=648701

Review-Url: https://codereview.chromium.org/2483653002
Cr-Commit-Position: refs/heads/master@{#431469}

[modify] https://crrev.com/810a7a208ae6566e497fd3412b3a6da885234d0a/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/810a7a208ae6566e497fd3412b3a6da885234d0a/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 14 by bugdroid1@chromium.org, Nov 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dbef379ab2b2c8a2127d20839f77d355e9f5742e

commit dbef379ab2b2c8a2127d20839f77d355e9f5742e
Author: mhashmi <mhashmi@chromium.org>
Date: Fri Nov 11 03:24:37 2016

Fix bug where removed (but not deleted) windows are not reflected in the tree properly

When there are windows which are removed as children of some parent, and
they still exist, OnWindowDestroying is not called because the child window
was never destroyed. However, OnWindowTreeChanging is called, if
the target has an old_parent, aka the parent it is being removed from.
OnWindowTreeChanged is called if the target has a new_parent, aka the
parent it is being added to.

This CL removes nodes on OnWindowTreeChanging and adds them back in
OnWindowTreeChanged if necessary. Since we only want them to trigger once,
we check to see in either callback if the window that the callback is
being called on is the old_parent or the new_parent.

BUG=648701

Review-Url: https://codereview.chromium.org/2476353002
Cr-Commit-Position: refs/heads/master@{#431482}

[modify] https://crrev.com/dbef379ab2b2c8a2127d20839f77d355e9f5742e/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/dbef379ab2b2c8a2127d20839f77d355e9f5742e/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/dbef379ab2b2c8a2127d20839f77d355e9f5742e/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Nov 11 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fb027e734b0b86cbe440c70d6a62f63fa5c4b7b9

commit fb027e734b0b86cbe440c70d6a62f63fa5c4b7b9
Author: hiroshige <hiroshige@chromium.org>
Date: Fri Nov 11 11:44:54 2016

Revert of Fix bug where removed (but not deleted) windows are not reflected in the tree properly (patchset #7 id:120001 of https://codereview.chromium.org/2476353002/ )

Reason for revert:
Suspected to cause SystemTrayTest.NullDefaultViewIsNotRecorded failure.

BUG= 664428 

Original issue's description:
> Fix bug where removed (but not deleted) windows are not reflected in the tree properly
>
> When there are windows which are removed as children of some parent, and
> they still exist, OnWindowDestroying is not called because the child window
> was never destroyed. However, OnWindowTreeChanging is called, if
> the target has an old_parent, aka the parent it is being removed from.
> OnWindowTreeChanged is called if the target has a new_parent, aka the
> parent it is being added to.
>
> This CL removes nodes on OnWindowTreeChanging and adds them back in
> OnWindowTreeChanged if necessary. Since we only want them to trigger once,
> we check to see in either callback if the window that the callback is
> being called on is the old_parent or the new_parent.
>
> BUG=648701
>
> Committed: https://crrev.com/dbef379ab2b2c8a2127d20839f77d355e9f5742e
> Cr-Commit-Position: refs/heads/master@{#431482}

TBR=sadrul@chromium.org,mhashmi@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=648701

Review-Url: https://codereview.chromium.org/2498593002
Cr-Commit-Position: refs/heads/master@{#431541}

[modify] https://crrev.com/fb027e734b0b86cbe440c70d6a62f63fa5c4b7b9/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/fb027e734b0b86cbe440c70d6a62f63fa5c4b7b9/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/fb027e734b0b86cbe440c70d6a62f63fa5c4b7b9/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Nov 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f555669c992a0bf22b8994d6a6f5a3f27e9f32c4

commit f555669c992a0bf22b8994d6a6f5a3f27e9f32c4
Author: mhashmi <mhashmi@chromium.org>
Date: Wed Nov 16 02:43:41 2016

Fix bug where removed (but not deleted) windows are not reflected in the tree properly

When there are windows which are removed as children of some parent, and
they still exist, OnWindowDestroying is not called because the child window
was never destroyed. However, OnWindowTreeChanging is called, if
the target has an old_parent, aka the parent it is being removed from.
OnWindowTreeChanged is called if the target has a new_parent, aka the
parent it is being added to.

This CL removes nodes on OnWindowTreeChanging and adds them back in
OnWindowTreeChanged if necessary. Since we only want them to trigger once,
we check to see in either callback if the window that the callback is
being called on is the old_parent or the new_parent.

BUG=648701

Review-Url: https://codereview.chromium.org/2495533005
Cr-Commit-Position: refs/heads/master@{#432366}

[modify] https://crrev.com/f555669c992a0bf22b8994d6a6f5a3f27e9f32c4/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/f555669c992a0bf22b8994d6a6f5a3f27e9f32c4/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/f555669c992a0bf22b8994d6a6f5a3f27e9f32c4/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 17 by bugdroid1@chromium.org, Nov 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e75795096a81f406c92afce687ef4aa54900845f

commit e75795096a81f406c92afce687ef4aa54900845f
Author: mhashmi <mhashmi@chromium.org>
Date: Wed Nov 16 04:46:02 2016

Revert of Fix bug where removed (but not deleted) windows are not reflected in the tree properly (patchset #2 id:20001 of https://codereview.chromium.org/2495533005/ )

Reason for revert:
SystemTrayTest.NullDefaultViewIsNotRecorded failing (https://build.chromium.org/p/chromium.win/builders/Win7%20Tests%20%281%29/builds/60026)

Original issue's description:
> Fix bug where removed (but not deleted) windows are not reflected in the tree properly
>
> When there are windows which are removed as children of some parent, and
> they still exist, OnWindowDestroying is not called because the child window
> was never destroyed. However, OnWindowTreeChanging is called, if
> the target has an old_parent, aka the parent it is being removed from.
> OnWindowTreeChanged is called if the target has a new_parent, aka the
> parent it is being added to.
>
> This CL removes nodes on OnWindowTreeChanging and adds them back in
> OnWindowTreeChanged if necessary. Since we only want them to trigger once,
> we check to see in either callback if the window that the callback is
> being called on is the old_parent or the new_parent.
>
> BUG=648701
>
> Committed: https://crrev.com/f555669c992a0bf22b8994d6a6f5a3f27e9f32c4
> Cr-Commit-Position: refs/heads/master@{#432366}

TBR=sadrul@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=648701

Review-Url: https://codereview.chromium.org/2506913002
Cr-Commit-Position: refs/heads/master@{#432374}

[modify] https://crrev.com/e75795096a81f406c92afce687ef4aa54900845f/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/e75795096a81f406c92afce687ef4aa54900845f/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/e75795096a81f406c92afce687ef4aa54900845f/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 18 by bugdroid1@chromium.org, Nov 16 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ba5ad2e37e2277f82d560caf172992d739e1b7c6

commit ba5ad2e37e2277f82d560caf172992d739e1b7c6
Author: mhashmi <mhashmi@chromium.org>
Date: Wed Nov 16 18:36:25 2016

Fix bug where removed (but not deleted) windows are not reflected in the tree properly

When there are windows which are removed as children of some parent, and
they still exist, OnWindowDestroying is not called because the child window
was never destroyed. However, OnWindowTreeChanging is called, if
the target has an old_parent, aka the parent it is being removed from.
OnWindowTreeChanged is called if the target has a new_parent, aka the
parent it is being added to.

This CL removes nodes on OnWindowTreeChanging and adds them back in
OnWindowTreeChanged if necessary. Since we only want them to trigger once,
we check to see in either callback if the window that the callback is
being called on is the old_parent or the new_parent.

BUG=648701

Review-Url: https://codereview.chromium.org/2508953002
Cr-Commit-Position: refs/heads/master@{#432568}

[modify] https://crrev.com/ba5ad2e37e2277f82d560caf172992d739e1b7c6/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/ba5ad2e37e2277f82d560caf172992d739e1b7c6/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/ba5ad2e37e2277f82d560caf172992d739e1b7c6/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 19 by bugdroid1@chromium.org, Nov 17 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/614f26621199fe032a65224b010f0d74f6969835

commit 614f26621199fe032a65224b010f0d74f6969835
Author: mhashmi <mhashmi@chromium.org>
Date: Thu Nov 17 05:24:56 2016

Add CSS agent for various window/widget/view attributes in devtools

This CL adds a few things:
- Three maps in DOM agent which map from the node Id to a window, widget
or view.
- Public methods to query these three maps.
- CSS Agent which receives the getMatchedStylesForNode command whenever a
node is selected in the inspector. The CSS Agent queries which object
the nodeId refers to using the passed in DOM agent and builds the CSS
object for it. For now, the only attributes this will show is bounds
height and width.
- protocol.json modified for the new CSS Agent

BUG=648701

Review-Url: https://codereview.chromium.org/2486543003
Cr-Commit-Position: refs/heads/master@{#432761}

[modify] https://crrev.com/614f26621199fe032a65224b010f0d74f6969835/ash/BUILD.gn
[add] https://crrev.com/614f26621199fe032a65224b010f0d74f6969835/ash/common/devtools/ash_devtools_css_agent.cc
[add] https://crrev.com/614f26621199fe032a65224b010f0d74f6969835/ash/common/devtools/ash_devtools_css_agent.h
[modify] https://crrev.com/614f26621199fe032a65224b010f0d74f6969835/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/614f26621199fe032a65224b010f0d74f6969835/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/614f26621199fe032a65224b010f0d74f6969835/ash/common/wm_shell.cc
[modify] https://crrev.com/614f26621199fe032a65224b010f0d74f6969835/components/ui_devtools/BUILD.gn
[modify] https://crrev.com/614f26621199fe032a65224b010f0d74f6969835/components/ui_devtools/protocol.json

Project Member

Comment 20 by bugdroid1@chromium.org, Nov 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6d1b1cb2d0fedff985eae5bd76fa13561262774e

commit 6d1b1cb2d0fedff985eae5bd76fa13561262774e
Author: mhashmi <mhashmi@chromium.org>
Date: Tue Nov 22 16:04:24 2016

Add UI DevTools under chrome://inspect/#other

This CL lists all clients that are attached to the UiDevToolsServer under
chrome://inspect/#other. In order to access the active devtools server,
we need to have the current (and only instance) as a static variable so
the inspect UI can get all the client urls.

In addition, we have a separate command, inspect-ui in inspect.js and
inspect_ui. This is because UiDevTools doesn't need any DevToolsHandler
as it has a custom backend. We simply open the link in a new tab when
the user clicks 'inspect'.

BUG=648701
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:closure_compilation

Review-Url: https://codereview.chromium.org/2502863002
Cr-Commit-Position: refs/heads/master@{#433878}

[modify] https://crrev.com/6d1b1cb2d0fedff985eae5bd76fa13561262774e/chrome/browser/resources/inspect/inspect.js
[modify] https://crrev.com/6d1b1cb2d0fedff985eae5bd76fa13561262774e/chrome/browser/ui/BUILD.gn
[modify] https://crrev.com/6d1b1cb2d0fedff985eae5bd76fa13561262774e/chrome/browser/ui/webui/inspect_ui.cc
[modify] https://crrev.com/6d1b1cb2d0fedff985eae5bd76fa13561262774e/chrome/browser/ui/webui/inspect_ui.h
[modify] https://crrev.com/6d1b1cb2d0fedff985eae5bd76fa13561262774e/components/ui_devtools/devtools_server.cc
[modify] https://crrev.com/6d1b1cb2d0fedff985eae5bd76fa13561262774e/components/ui_devtools/devtools_server.h

Project Member

Comment 21 by bugdroid1@chromium.org, Nov 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/7d1faa6c9ea5f4d5a2c10414d8a33b75a9f190e7

commit 7d1faa6c9ea5f4d5a2c10414d8a33b75a9f190e7
Author: mhashmi <mhashmi@chromium.org>
Date: Tue Nov 22 23:53:16 2016

Add ViewObserver to View for view updates

- OnViewParentChanged for whenever a view is added/removed
- OnViewVisibilityChanged, OnViewEnabledChanged, OnViewBoundsChanged
are all for attribute changes
- OnViewChildReordered for whenever a view is reordered within its parent

Future CLs will allow devtools for listen to view changes and push them
to the inspector.

BUG=648701

Review-Url: https://codereview.chromium.org/2500623002
Cr-Commit-Position: refs/heads/master@{#434026}

[modify] https://crrev.com/7d1faa6c9ea5f4d5a2c10414d8a33b75a9f190e7/ui/views/BUILD.gn
[modify] https://crrev.com/7d1faa6c9ea5f4d5a2c10414d8a33b75a9f190e7/ui/views/view.cc
[modify] https://crrev.com/7d1faa6c9ea5f4d5a2c10414d8a33b75a9f190e7/ui/views/view.h
[add] https://crrev.com/7d1faa6c9ea5f4d5a2c10414d8a33b75a9f190e7/ui/views/view_observer.h
[modify] https://crrev.com/7d1faa6c9ea5f4d5a2c10414d8a33b75a9f190e7/ui/views/view_unittest.cc

Project Member

Comment 22 by bugdroid1@chromium.org, Nov 23 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cb3910d325c997dc3746667cde868ebf5435c3aa

commit cb3910d325c997dc3746667cde868ebf5435c3aa
Author: mhashmi <mhashmi@chromium.org>
Date: Wed Nov 23 15:05:34 2016

Notify WidgetRemovalsObserver when RootView is removed

RootViews are destroyed before OnWindowDestroying when widgets are initialized
with ownership set to Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET.
In this case, WidgetObservers will never be able to get a
reference to a RootView. This CL notifies WidgetRemovalsObservers
when a RootView is being removed using the existing WillRemoveView.

BUG=648701

Review-Url: https://codereview.chromium.org/2522093002
Cr-Commit-Position: refs/heads/master@{#434167}

[modify] https://crrev.com/cb3910d325c997dc3746667cde868ebf5435c3aa/ui/views/widget/widget.cc
[modify] https://crrev.com/cb3910d325c997dc3746667cde868ebf5435c3aa/ui/views/widget/widget_unittest.cc

Project Member

Comment 23 by bugdroid1@chromium.org, Nov 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/dd0bb09f4fd6d80996b147bec0a1c6b142d5d42f

commit dd0bb09f4fd6d80996b147bec0a1c6b142d5d42f
Author: mhashmi <mhashmi@chromium.org>
Date: Sat Nov 26 02:49:26 2016

Fix bug where CSS styles are requested after node is destroyed

There's a bug which causes a crash when a node is highlighted in the
inspector and the corresponding object is destroyed in Ash. This somehow
triggers the frontend to request the styles for that node again, so
instead of NOTREACHED(), we simply return an error.

BUG=648701

Review-Url: https://codereview.chromium.org/2524863004
Cr-Commit-Position: refs/heads/master@{#434563}

[modify] https://crrev.com/dd0bb09f4fd6d80996b147bec0a1c6b142d5d42f/ash/common/devtools/ash_devtools_css_agent.cc

Project Member

Comment 24 by bugdroid1@chromium.org, Nov 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2349585314f727a4aba3cf37680fe4dab999a044

commit 2349585314f727a4aba3cf37680fe4dab999a044
Author: mhashmi <mhashmi@chromium.org>
Date: Sat Nov 26 04:13:20 2016

Refactor remove methods, add DCHECKS, and remove_observer boolean

This CL addresses 5 minor things:
- Reorganize methods so we have methods for windows followed by widgets followed by views.
- Removing nodes and removing subtrees separated into different methods
- Added multiple DCHECKS
- Added |remove_observer| boolean to all Remove* methods so that we can
avoid situations where we remove an observer and add it back again
in the same callback. This could cause the callback to be called
endlessly. |remove_obsever| is false whenever we know we will add
back the nodes again.
- Added methods for removing view subtrees

BUG=648701

Review-Url: https://codereview.chromium.org/2527573003
Cr-Commit-Position: refs/heads/master@{#434567}

[modify] https://crrev.com/2349585314f727a4aba3cf37680fe4dab999a044/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/2349585314f727a4aba3cf37680fe4dab999a044/ash/common/devtools/ash_devtools_dom_agent.h

Project Member

Comment 25 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b4ce166c6eb7bf65dedbdb6947e23fbf2992e251

commit b4ce166c6eb7bf65dedbdb6947e23fbf2992e251
Author: mhashmi <mhashmi@chromium.org>
Date: Tue Nov 29 03:11:06 2016

Hook up views/widgets to AshDevToolsDOMAgent

- This CL adds AshDevToolsDOMAgent as an observer to all widgets and views.
The WidgetRemovalObserver is specifically to remove the RootView subtree,
while the ViewObserver is to update any other descendant views.
AddViewTree was created so that whenever any |view| is added, it can
be pushed to the frontend.
- Add tests for when views are inserted, removed, rearranged,
removed & inserted.
- Add test to check if a widget owned by a native widget is represented
properly in the DOM.

BUG=648701

Review-Url: https://codereview.chromium.org/2529553002
Cr-Commit-Position: refs/heads/master@{#434863}

[modify] https://crrev.com/b4ce166c6eb7bf65dedbdb6947e23fbf2992e251/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/b4ce166c6eb7bf65dedbdb6947e23fbf2992e251/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/b4ce166c6eb7bf65dedbdb6947e23fbf2992e251/ash/common/devtools/ash_devtools_unittest.cc

I am reverting the last CL due to a memory leak.

https://uberchromegw.corp.google.com/i/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%281%29/builds/17979/steps/ash_unittests%20on%20Ubuntu-12.04/logs/AshDevToolsTest.ViewRemoved
AshDevToolsTest.ViewRemoved (run #1):
[ RUN      ] AshDevToolsTest.ViewRemoved
Xlib:  extension "RANDR" missing on display ":99".
[       OK ] AshDevToolsTest.ViewRemoved (478 ms)
[----------] 1 test from AshDevToolsTest (478 ms total)

[----------] Global test environment tear-down
[==========] 1 test from 1 test case ran. (478 ms total)
[  PASSED  ] 1 test.

=================================================================
==17970==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 488 byte(s) in 1 object(s) allocated from:
    #0 0x631f4b in operator new(unsigned long) (/b/swarm_slave/w/irt_nwTH/out/Release/ash_unittests+0x631f4b)
    #1 0x6d16bb in ash::AshDevToolsTest_ViewRemoved_Test::TestBody() ash/common/devtools/ash_devtools_unittest.cc:376:29
    #2 0x2b14597 in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12
    #3 0x2b14597 in testing::Test::Run() testing/gtest/src/gtest.cc:2474
    #4 0x2b16694 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11
    #5 0x2b17466 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #6 0x2b2af26 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #7 0x2b2a447 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #8 0x2b2a447 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #9 0x1f63c98 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #10 0x1f63c98 in base::TestSuite::Run() base/test/test_suite.cc:271
    #11 0x1f670c8 in Run base/callback.h:85:12
    #12 0x1f670c8 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:211
    #13 0x1f66d1e in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:453:10
    #14 0xdbd3ea in main ash/test/ash_unittests.cc:14:10
    #15 0x7f413d1767ec in __libc_start_main /build/eglibc-oqps9y/eglibc-2.15/csu/libc-start.c:226

Indirect leak of 512 byte(s) in 1 object(s) allocated from:
    #0 0x631f4b in operator new(unsigned long) (/b/swarm_slave/w/irt_nwTH/out/Release/ash_unittests+0x631f4b)
    #1 0x2cc270c in allocate build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ext/new_allocator.h:92:27
    #2 0x2cc270c in _M_allocate_node build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:525
    #3 0x2cc270c in _M_create_nodes build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:619
    #4 0x2cc270c in _M_initialize_map build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:593
    #5 0x2cc270c in _Deque_base build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:452
    #6 0x2cc270c in deque build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:772
    #7 0x2cc270c in ui::EventHandler::EventHandler() ui/events/event_handler.cc:12
    #8 0x2f651aa in views::View::View() ui/views/view.cc:102:7
    #9 0x6d16c6 in ash::AshDevToolsTest_ViewRemoved_Test::TestBody() ash/common/devtools/ash_devtools_unittest.cc:376:33
    #10 0x2b14597 in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12
    #11 0x2b14597 in testing::Test::Run() testing/gtest/src/gtest.cc:2474
    #12 0x2b16694 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11
    #13 0x2b17466 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #14 0x2b2af26 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #15 0x2b2a447 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #16 0x2b2a447 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #17 0x1f63c98 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #18 0x1f63c98 in base::TestSuite::Run() base/test/test_suite.cc:271
    #19 0x1f670c8 in Run base/callback.h:85:12
    #20 0x1f670c8 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:211
    #21 0x1f66d1e in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:453:10
    #22 0xdbd3ea in main ash/test/ash_unittests.cc:14:10
    #23 0x7f413d1767ec in __libc_start_main /build/eglibc-oqps9y/eglibc-2.15/csu/libc-start.c:226

Indirect leak of 64 byte(s) in 1 object(s) allocated from:
    #0 0x631f4b in operator new(unsigned long) (/b/swarm_slave/w/irt_nwTH/out/Release/ash_unittests+0x631f4b)
    #1 0x2cc26fb in allocate build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ext/new_allocator.h:92:27
    #2 0x2cc26fb in _M_allocate_map build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:536
    #3 0x2cc26fb in _M_initialize_map build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:581
    #4 0x2cc26fb in _Deque_base build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:452
    #5 0x2cc26fb in deque build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_deque.h:772
    #6 0x2cc26fb in ui::EventHandler::EventHandler() ui/events/event_handler.cc:12
    #7 0x2f651aa in views::View::View() ui/views/view.cc:102:7
    #8 0x6d16c6 in ash::AshDevToolsTest_ViewRemoved_Test::TestBody() ash/common/devtools/ash_devtools_unittest.cc:376:33
    #9 0x2b14597 in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12
    #10 0x2b14597 in testing::Test::Run() testing/gtest/src/gtest.cc:2474
    #11 0x2b16694 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11
    #12 0x2b17466 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #13 0x2b2af26 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #14 0x2b2a447 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #15 0x2b2a447 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #16 0x1f63c98 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #17 0x1f63c98 in base::TestSuite::Run() base/test/test_suite.cc:271
    #18 0x1f670c8 in Run base/callback.h:85:12
    #19 0x1f670c8 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:211
    #20 0x1f66d1e in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:453:10
    #21 0xdbd3ea in main ash/test/ash_unittests.cc:14:10
    #22 0x7f413d1767ec in __libc_start_main /build/eglibc-oqps9y/eglibc-2.15/csu/libc-start.c:226

Indirect leak of 8 byte(s) in 1 object(s) allocated from:
    #0 0x631f4b in operator new(unsigned long) (/b/swarm_slave/w/irt_nwTH/out/Release/ash_unittests+0x631f4b)
    #1 0x2f855bf in allocate build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/ext/new_allocator.h:92:27
    #2 0x2f855bf in _M_allocate build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_vector.h:150
    #3 0x2f855bf in void std::vector<views::ViewObserver*, std::allocator<views::ViewObserver*> >::_M_insert_aux<views::ViewObserver* const&>(__gnu_cxx::__normal_iterator<views::ViewObserver**, std::vector<views::ViewObserver*, std::allocator<views::ViewObserver*> > >, views::ViewObserver* const&) build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/vector.tcc:327
    #4 0x2f7bd04 in push_back build/linux/ubuntu_precise_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_vector.h:834:4
    #5 0x2f7bd04 in base::ObserverListBase<views::ViewObserver>::AddObserver(views::ViewObserver*) base/observer_list.h:279
    #6 0x2f7b7a3 in views::View::AddObserver(views::ViewObserver*) ui/views/view.cc:1386:14
    #7 0x199137c in ash::devtools::AshDevToolsDOMAgent::BuildTreeForView(views::View*) ash/common/devtools/ash_devtools_dom_agent.cc:234:11
    #8 0x1990d5a in ash::devtools::AshDevToolsDOMAgent::BuildTreeForView(views::View*) ash/common/devtools/ash_devtools_dom_agent.cc:230:23
    #9 0x198f9c7 in ash::devtools::AshDevToolsDOMAgent::BuildTreeForRootWidget(views::Widget*) ash/common/devtools/ash_devtools_dom_agent.cc:215:21
    #10 0x198dc37 in ash::devtools::AshDevToolsDOMAgent::BuildTreeForWindow(ash::WmWindow*) ash/common/devtools/ash_devtools_dom_agent.cc:198:23
    #11 0x198de33 in ash::devtools::AshDevToolsDOMAgent::BuildTreeForWindow(ash::WmWindow*) ash/common/devtools/ash_devtools_dom_agent.cc:200:23
    #12 0x198de33 in ash::devtools::AshDevToolsDOMAgent::BuildTreeForWindow(ash::WmWindow*) ash/common/devtools/ash_devtools_dom_agent.cc:200:23
    #13 0x198de33 in ash::devtools::AshDevToolsDOMAgent::BuildTreeForWindow(ash::WmWindow*) ash/common/devtools/ash_devtools_dom_agent.cc:200:23
    #14 0x198a142 in ash::devtools::AshDevToolsDOMAgent::BuildInitialTree() ash/common/devtools/ash_devtools_dom_agent.cc:188:23
    #15 0x1989dce in ash::devtools::AshDevToolsDOMAgent::getDocument(std::unique_ptr<ui::devtools::protocol::DOM::Node, std::default_delete<ui::devtools::protocol::DOM::Node> >*) ash/common/devtools/ash_devtools_dom_agent.cc:99:15
    #16 0x6d175b in ash::AshDevToolsTest_ViewRemoved_Test::TestBody() ash/common/devtools/ash_devtools_unittest.cc:381:16
    #17 0x2b14597 in HandleExceptionsInMethodIfSupported<testing::Test, void> testing/gtest/src/gtest.cc:2458:12
    #18 0x2b14597 in testing::Test::Run() testing/gtest/src/gtest.cc:2474
    #19 0x2b16694 in testing::TestInfo::Run() testing/gtest/src/gtest.cc:2656:11
    #20 0x2b17466 in testing::TestCase::Run() testing/gtest/src/gtest.cc:2774:28
    #21 0x2b2af26 in testing::internal::UnitTestImpl::RunAllTests() testing/gtest/src/gtest.cc:4647:43
    #22 0x2b2a447 in HandleExceptionsInMethodIfSupported<testing::internal::UnitTestImpl, bool> testing/gtest/src/gtest.cc:2458:12
    #23 0x2b2a447 in testing::UnitTest::Run() testing/gtest/src/gtest.cc:4255
    #24 0x1f63c98 in RUN_ALL_TESTS testing/gtest/include/gtest/gtest.h:2237:46
    #25 0x1f63c98 in base::TestSuite::Run() base/test/test_suite.cc:271
    #26 0x1f670c8 in Run base/callback.h:85:12
    #27 0x1f670c8 in base::(anonymous namespace)::LaunchUnitTestsInternal(base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&, int, int, bool, base::Callback<void (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:211
    #28 0x1f66d1e in base::LaunchUnitTests(int, char**, base::Callback<int (), (base::internal::CopyMode)1, (base::internal::RepeatMode)1> const&) base/test/launcher/unit_test_launcher.cc:453:10
    #29 0xdbd3ea in main ash/test/ash_unittests.cc:14:10
    #30 0x7f413d1767ec in __libc_start_main /build/eglibc-oqps9y/eglibc-2.15/csu/libc-start.c:226

Project Member

Comment 27 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f640d3cbd00447abe17877078f14c73ad6aca26d

commit f640d3cbd00447abe17877078f14c73ad6aca26d
Author: battre <battre@chromium.org>
Date: Tue Nov 29 09:45:16 2016

Revert of Hook up views/widgets to AshDevToolsDOMAgent (patchset #3 id:40001 of https://codereview.chromium.org/2529553002/ )

Reason for revert:
Reverting due to a memory leak. See http://crbug.com/648701#c26

Original issue's description:
> Hook up views/widgets to AshDevToolsDOMAgent
>
> - This CL adds AshDevToolsDOMAgent as an observer to all widgets and views.
> The WidgetRemovalObserver is specifically to remove the RootView subtree,
> while the ViewObserver is to update any other descendant views.
> AddViewTree was created so that whenever any |view| is added, it can
> be pushed to the frontend.
> - Add tests for when views are inserted, removed, rearranged,
> removed & inserted.
> - Add test to check if a widget owned by a native widget is represented
> properly in the DOM.
>
> BUG=648701
>
> Committed: https://crrev.com/b4ce166c6eb7bf65dedbdb6947e23fbf2992e251
> Cr-Commit-Position: refs/heads/master@{#434863}

TBR=sadrul@chromium.org,mhashmi@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=648701

Review-Url: https://codereview.chromium.org/2532243003
Cr-Commit-Position: refs/heads/master@{#434941}

[modify] https://crrev.com/f640d3cbd00447abe17877078f14c73ad6aca26d/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/f640d3cbd00447abe17877078f14c73ad6aca26d/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/f640d3cbd00447abe17877078f14c73ad6aca26d/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 28 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/2854d5e5eab2824f1151a0b4e813ff535ea3f8a6

commit 2854d5e5eab2824f1151a0b4e813ff535ea3f8a6
Author: mhashmi <mhashmi@chromium.org>
Date: Tue Nov 29 20:10:38 2016

Hook up views/widgets to AshDevToolsDOMAgent

- This CL adds AshDevToolsDOMAgent as an observer to all widgets and views.
The WidgetRemovalObserver is specifically to remove the RootView subtree,
while the ViewObserver is to update any other descendant views.
AddViewTree was created so that whenever any |view| is added, it can
be pushed to the frontend.
- Add tests for when views are inserted, removed, rearranged,
removed & inserted.
- Add test to check if a widget owned by a native widget is represented
properly in the DOM.

BUG=648701

Review-Url: https://codereview.chromium.org/2537163002
Cr-Commit-Position: refs/heads/master@{#435065}

[modify] https://crrev.com/2854d5e5eab2824f1151a0b4e813ff535ea3f8a6/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/2854d5e5eab2824f1151a0b4e813ff535ea3f8a6/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/2854d5e5eab2824f1151a0b4e813ff535ea3f8a6/ash/common/devtools/ash_devtools_unittest.cc

Project Member

Comment 29 by bugdroid1@chromium.org, Nov 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/05f37a32d257869410cf10227d3761a4a28882c3

commit 05f37a32d257869410cf10227d3761a4a28882c3
Author: mhashmi <mhashmi@chromium.org>
Date: Wed Nov 30 22:25:34 2016

Add live updates for AshDevToolsCSSAgent

- This CL adds an AshDevToolsDOMAgentObserver so that other agents, namely
CSS and Animation agents can observer when windows are added or removed
from the frontend.
- Add styleSheetChanged method to CSS protocol and call it from the
AshDevToolsCSSAgent whenever the bounds for any object is changed.
styleSheetChanged method called with an empty string simply invalidates
all styles in the inspector. There is currently no way to invalidate
styles on a single node.

BUG=648701

Review-Url: https://codereview.chromium.org/2526103002
Cr-Commit-Position: refs/heads/master@{#435446}

[modify] https://crrev.com/05f37a32d257869410cf10227d3761a4a28882c3/ash/common/devtools/ash_devtools_css_agent.cc
[modify] https://crrev.com/05f37a32d257869410cf10227d3761a4a28882c3/ash/common/devtools/ash_devtools_css_agent.h
[modify] https://crrev.com/05f37a32d257869410cf10227d3761a4a28882c3/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/05f37a32d257869410cf10227d3761a4a28882c3/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/05f37a32d257869410cf10227d3761a4a28882c3/components/ui_devtools/protocol.json

Project Member

Comment 30 by bugdroid1@chromium.org, Dec 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ae977ac4847526a5674b7898617369e6d272cde7

commit ae977ac4847526a5674b7898617369e6d272cde7
Author: mhashmi <mhashmi@chromium.org>
Date: Wed Dec 07 21:42:47 2016

Add hovering feature to AshDevToolsDOMAgent

Hovering over any element in the frontend inspector will now highlight
the corresponding Ash window/widget/view. The highlight and border
color is whatever DevTools provides us in the highlightConfig. Currently,
this is a slightly transparent light blue overlay with a dark yellow
border.

How this is done:
- Create a widget in the primary root window under the OverlayContainer.
- Whenever a node is highlighted, call AshDevToolsDOMAgent::HighlightNode
on the main thread, which then determines where the object is (i.e: bounds)
and what display it is on.
- The parent |window| for the the |widget| that we created will update its
bounds and the |root_view| of the widget has its border/background color
updated to those provided in the highlightConfig.
- When no node is being hovered over, hideHighlight is called by the frontend
and we simply hide the widget.
- We also do not want to show the |widget| in the DOM tree, so if we ever
encounter its parent |window|, it will be ignored.

BUG=648701

Review-Url: https://codereview.chromium.org/2542243002
Cr-Commit-Position: refs/heads/master@{#437069}

[modify] https://crrev.com/ae977ac4847526a5674b7898617369e6d272cde7/ash/common/devtools/ash_devtools_dom_agent.cc
[modify] https://crrev.com/ae977ac4847526a5674b7898617369e6d272cde7/ash/common/devtools/ash_devtools_dom_agent.h
[modify] https://crrev.com/ae977ac4847526a5674b7898617369e6d272cde7/components/ui_devtools/devtools_server.cc
[modify] https://crrev.com/ae977ac4847526a5674b7898617369e6d272cde7/components/ui_devtools/devtools_server.h
[modify] https://crrev.com/ae977ac4847526a5674b7898617369e6d272cde7/components/ui_devtools/protocol.json

Project Member

Comment 31 by bugdroid1@chromium.org, Dec 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d35614ff6bf165d7aec31b2e9bb45cadecdce21e

commit d35614ff6bf165d7aec31b2e9bb45cadecdce21e
Author: mhashmi <mhashmi@chromium.org>
Date: Wed Dec 07 21:49:51 2016

Make bounds editable through the CSS sidepanel

This CL adds the feature which allows users to edit
bounds (i.e: height, width, x, y) of any window/widget/view in Ash by
simply updating them in the CSS sidepanel.

- In order to make fields editable, all CSSStyle and CSSProperty objects
sent require a range field, which in our case is all 0s
because we don't have any stylesheets.
- Added setStyleTexts which is the command called by the frontend whenever
a CSS property is updated. This is sent to the CSSAgent in the form of
text. Example: "height: 1;"
- The text received in setStyleTexts is parsed by the CSSAgent, and
put into a bounds object. Any bounds properties not included in the
|style_text| must default to the original property value for that window,
widget or view.
- The updated bounds are sent back to the frontend and the bounds for the
object are updated on the main thread.
- A lot of error checking must happen as well. This CL checks for the
following cases: invalid node id, node id valid but not found, unsupported
property and invalid value for a given property.

BUG=648701

Review-Url: https://codereview.chromium.org/2548103002
Cr-Commit-Position: refs/heads/master@{#437072}

[modify] https://crrev.com/d35614ff6bf165d7aec31b2e9bb45cadecdce21e/ash/common/devtools/ash_devtools_css_agent.cc
[modify] https://crrev.com/d35614ff6bf165d7aec31b2e9bb45cadecdce21e/ash/common/devtools/ash_devtools_css_agent.h
[modify] https://crrev.com/d35614ff6bf165d7aec31b2e9bb45cadecdce21e/components/ui_devtools/protocol.json

Project Member

Comment 32 by bugdroid1@chromium.org, Dec 7 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b1a6e98d9bcf2b49555dc0056e3e7ca40eabbd80

commit b1a6e98d9bcf2b49555dc0056e3e7ca40eabbd80
Author: mhashmi <mhashmi@chromium.org>
Date: Wed Dec 07 22:07:47 2016

Add tests for highlighting, editing and updating CSS styles for UI DevTools

This CL adds test coverage for the following:
- Tests for highlighting window, widget, view on single/multiple display
- Tests for editing CSS styles (bounds for now) from the frontend
- When bounds get updated, the frontend should be notified of updates.
This is also tested.

BUG=648701

Review-Url: https://codereview.chromium.org/2552913002
Cr-Commit-Position: refs/heads/master@{#437077}

[modify] https://crrev.com/b1a6e98d9bcf2b49555dc0056e3e7ca40eabbd80/ash/common/devtools/ash_devtools_unittest.cc

Owner: sadrul@chromium.org
mhashmi@ is no longer working on this. Assigning to sadrul@ for triage.
Labels: Hotlist-UI-DevTools
Components: -Platform>DevTools
Components: -Internals>MUS Internals>Services>WindowService
Labels: -Proj-Mustash-Mus-WS
Deprecating label Proj-Mustash-Mus-WS in favor of Components.

Sign in to add a comment