Chromium Code Reviews

Issue 4202004: Add named testing interface (Closed)

Created:
10 years, 1 month ago by dtu
Modified:
9 years, 7 months ago
Reviewers:
Nirnimesh, John Grabowski, amit, Evan Martin, Paweł Hajdan Jr., agl
CC:
chromium-reviews, pam+watch_chromium.org, darin-cc_chromium.org, ben+cc_chromium.org, sky, krisr
Visibility:
Public.

Description

Add named testing interface. This allows you to connect to a pre-existing Chrome process and run tests on it. This is an addition to the low level interface underlying testing frameworks like PyAuto and WebDriver. Normally, test frameworks communicate with Chrome over an unnamed socket pair on POSIX. The test creates the socket pair and then launches the browser as a child process, passing an open file descriptor for one end of the socket to the browser. This change adds a command line switch that, when passed to the browser, causes it to listen on a named socket instead, eliminating this parent/child process requirement. Therefore, you can potentially connect any number of tests to a preexisting browser process. For ChromeOS, this allows you to run tests on the instance of Chrome that is launched on startup, which controls things like the login and lock screens, the battery meter, the wireless UI, etc. Currently there is no way to run tests on a pre-existing Chrome instance. Eventually this will also allow you to connect both PyAuto and WebDriver to the same Chrome instance and run both in the same test. If you pass the browser the following command line switch: ./chrome --testing-channel=NamedTestingInterface:/path/to/file This causes the browser to listen for incoming connections. An AutomationProxy can connect to the browser by connecting a Unix domain socket to the specified path and control the browser over the socket. This is currently only for POSIX. Windows support will come in a future change. Also, this initial change only allows one connection; multiple connection support will come in a future change. BUG=chromium-os:8512 TEST=Run Chrome with --testing-interface=/var/tmp/NamedTestingInterface, then run NamedInterfaceTest.BasicNamedInterface under ui_tests. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67300

Patch Set 1 #

Total comments: 11

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 20

Patch Set 4 : '' #

Total comments: 39

Patch Set 5 : '' #

Patch Set 6 : '' #

Total comments: 7

Patch Set 7 : '' #

Total comments: 23

Patch Set 8 : '' #

Total comments: 20

Patch Set 9 : '' #

Total comments: 28

Patch Set 10 : '' #

Total comments: 18

Patch Set 11 : '' #

Total comments: 13

Patch Set 12 : '' #

Patch Set 13 : '' #

Total comments: 9

Patch Set 14 : '' #

Total comments: 3

Patch Set 15 : '' #

Patch Set 16 : '' #

Patch Set 17 : '' #

Total comments: 3

Patch Set 18 : '' #

Patch Set 19 : '' #

Unified diffs Side-by-side diffs Stats (+447 lines, -92 lines)
M chrome/browser/automation/automation_provider.h View 4 chunks +20 lines, -4 lines 0 comments
M chrome/browser/automation/automation_provider.cc View 4 chunks +48 lines, -15 lines 0 comments
M chrome/browser/automation/automation_provider_observers.cc View 1 chunk +1 line, -1 line 0 comments
M chrome/browser/ui/browser_init.h View 1 chunk +1 line, -1 line 0 comments
M chrome/browser/ui/browser_init.cc View 3 chunks +15 lines, -8 lines 0 comments
M chrome/chrome_tests.gypi View 4 chunks +9 lines, -0 lines 0 comments
M chrome/common/automation_constants.h View 2 chunks +9 lines, -1 line 0 comments
M chrome/common/automation_constants.cc View 2 chunks +8 lines, -1 line 0 comments
M chrome/test/automation/automation_proxy.h View 3 chunks +11 lines, -7 lines 0 comments
M chrome/test/automation/automation_proxy.cc View 5 chunks +7 lines, -7 lines 0 comments
M chrome/test/automation/automation_proxy_uitest.h View 1 chunk +4 lines, -3 lines 0 comments
M chrome/test/automation/automation_proxy_uitest.cc View 3 chunks +32 lines, -3 lines 0 comments
A chrome/test/automation/proxy_launcher.h View 1 chunk +78 lines, -0 lines 0 comments
A chrome/test/automation/proxy_launcher.cc View 1 chunk +75 lines, -0 lines 0 comments
A chrome/test/ui/named_interface_uitest.cc View 1 chunk +42 lines, -0 lines 0 comments
M chrome/test/ui/ui_test.h View 8 chunks +19 lines, -8 lines 0 comments
M chrome/test/ui/ui_test.cc View 9 chunks +39 lines, -21 lines 0 comments
M chrome_frame/chrome_frame.gyp View 1 chunk +3 lines, -0 lines 0 comments
M chrome_frame/chrome_frame_automation.h View 1 chunk +1 line, -0 lines 0 comments
M chrome_frame/chrome_frame_automation.cc View 3 chunks +8 lines, -3 lines 0 comments
M chrome_frame/test/automation_client_mock.cc View 2 chunks +2 lines, -2 lines 0 comments
M chrome_frame/test/net/test_automation_provider.cc View 1 chunk +1 line, -1 line 0 comments
M ipc/ipc_channel.h View 1 chunk +3 lines, -1 line 0 comments
M ipc/ipc_channel_posix.cc View 3 chunks +11 lines, -5 lines 0 comments

Messages

Total messages: 56 (0 generated)
dtu
http://codereview.chromium.org/4202004/diff/1/4 File chrome/browser/browser_init.cc (right): http://codereview.chromium.org/4202004/diff/1/4#newcode1025 chrome/browser/browser_init.cc:1025: if (!channel_id.empty() && channel_id[0] == '/') add comments Use: ...
10 years, 1 month ago (2010-10-28 19:17:51 UTC) #1
John Grabowski
Also wait for Pawel feedback http://codereview.chromium.org/4202004/diff/22001/23001 File chrome/browser/automation/automation_provider.cc (right): http://codereview.chromium.org/4202004/diff/22001/23001#newcode161 chrome/browser/automation/automation_provider.cc:161: new IPC::SyncChannel(channel_id, is_server ? ...
10 years, 1 month ago (2010-10-28 20:43:54 UTC) #2
dtu
PTAL http://codereview.chromium.org/4202004/diff/22001/23001 File chrome/browser/automation/automation_provider.cc (right): http://codereview.chromium.org/4202004/diff/22001/23001#newcode161 chrome/browser/automation/automation_provider.cc:161: new IPC::SyncChannel(channel_id, is_server ? IPC::Channel::MODE_SERVER : On 2010/10/28 ...
10 years, 1 month ago (2010-10-29 01:07:10 UTC) #3
Nirnimesh
+Scott as reviewer, for reviewing the change to ipc_channel_posix.cc (or please suggest someone else who ...
10 years, 1 month ago (2010-10-29 06:40:17 UTC) #4
Paweł Hajdan Jr.
Do you have some design documents for this new testing interface? I would like to ...
10 years, 1 month ago (2010-10-29 10:05:18 UTC) #5
sky
On Thu, Oct 28, 2010 at 11:40 PM, <nirnimesh@chromium.org> wrote: > +Scott as reviewer, for ...
10 years, 1 month ago (2010-10-29 14:59:41 UTC) #6
John Grabowski
At a higher level, Pawel has a good thought that a better description of the ...
10 years, 1 month ago (2010-10-31 05:15:22 UTC) #7
dtu
This named testing interface is not an alternative to PyAuto or WebDriver, but rather is ...
10 years, 1 month ago (2010-11-01 19:56:33 UTC) #8
Nirnimesh
-sky +evan as reviewer for ipc_channel_posix changes http://codereview.chromium.org/4202004/diff/1011/34007 File chrome/test/named_testing_interface/named_interface_test.cc (right): http://codereview.chromium.org/4202004/diff/1011/34007#newcode9 chrome/test/named_testing_interface/named_interface_test.cc:9: class NamedInterfaceTest ...
10 years, 1 month ago (2010-11-01 23:59:24 UTC) #9
dtu
http://codereview.chromium.org/4202004/diff/1011/34007 File chrome/test/named_testing_interface/named_interface_test.cc (right): http://codereview.chromium.org/4202004/diff/1011/34007#newcode9 chrome/test/named_testing_interface/named_interface_test.cc:9: class NamedInterfaceTest : public UITest { On 2010/11/01 23:59:24, ...
10 years, 1 month ago (2010-11-02 00:46:14 UTC) #10
Nirnimesh
Code I commented LGTM, after the one comment below. Let's wait for someone for the ...
10 years, 1 month ago (2010-11-02 01:12:16 UTC) #11
Paweł Hajdan Jr.
I'd really like to know the rationale behind this change in more detail, and the ...
10 years, 1 month ago (2010-11-02 08:16:28 UTC) #12
krisr
So there are two reasons for this change. One I know a lot about one, ...
10 years, 1 month ago (2010-11-02 08:39:51 UTC) #13
Paweł Hajdan Jr.
On Tue, Nov 2, 2010 at 09:39, Kris Rambish <krisr@chromium.org> wrote: > So there are ...
10 years, 1 month ago (2010-11-02 12:42:23 UTC) #14
dtu
On Tue, Nov 2, 2010 at 1:16 AM, <phajdan.jr@chromium.org> wrote: > I'd really like to ...
10 years, 1 month ago (2010-11-03 07:19:42 UTC) #15
Paweł Hajdan Jr.
On Wed, Nov 3, 2010 at 08:19, Dave Tu <dtu@chromium.org> wrote: > On Tue, Nov ...
10 years, 1 month ago (2010-11-03 07:39:50 UTC) #16
Nirnimesh
> Well, we haven't really changed the design for PyAuto and WebDriver, and we > ...
10 years, 1 month ago (2010-11-03 20:25:39 UTC) #17
dtu
http://codereview.chromium.org/4202004/diff/55001/56004 File chrome/chrome_tests.gypi (right): http://codereview.chromium.org/4202004/diff/55001/56004#newcode509 chrome/chrome_tests.gypi:509: 'test/named_testing_interface/named_interface_test.cc', On 2010/11/02 01:12:17, Nirnimesh wrote: > follow the ...
10 years, 1 month ago (2010-11-04 00:39:56 UTC) #18
Paweł Hajdan Jr.
+jabdelmalek for ipc comments Nirnimesh, thanks for explaining, especially the perf test parts. Please note ...
10 years, 1 month ago (2010-11-04 07:58:26 UTC) #19
dtu
I'm sorry, I've had to revert the change that moved the named socket code out ...
10 years, 1 month ago (2010-11-05 03:05:01 UTC) #20
dtu
I'm sorry, I've had to revert the change that moved the named socket code out ...
10 years, 1 month ago (2010-11-05 03:05:01 UTC) #21
John Grabowski
On Thu, Nov 4, 2010 at 12:58 AM, <phajdan.jr@chromium.org> wrote: > +jabdelmalek for ipc comments ...
10 years, 1 month ago (2010-11-05 04:32:55 UTC) #22
Paweł Hajdan Jr.
On 2010/11/05 04:32:55, John Grabowski wrote: > Hmm. Do you really think it's a better ...
10 years, 1 month ago (2010-11-05 15:18:26 UTC) #23
John Grabowski
On Fri, Nov 5, 2010 at 8:18 AM, <phajdan.jr@chromium.org> wrote: > On 2010/11/05 04:32:55, John ...
10 years, 1 month ago (2010-11-05 17:27:11 UTC) #24
dtu
On 2010/11/05 17:27:11, John Grabowski wrote: > On Fri, Nov 5, 2010 at 8:18 AM, ...
10 years, 1 month ago (2010-11-05 18:51:51 UTC) #25
dtu
jrg gave me some basic pointers and I was able to refactor out the scattered ...
10 years, 1 month ago (2010-11-06 02:55:13 UTC) #26
Nirnimesh
http://codereview.chromium.org/4202004/diff/179001/180002 File chrome/browser/automation/automation_provider.h (right): http://codereview.chromium.org/4202004/diff/179001/180002#newcode415 chrome/browser/automation/automation_provider.h:415: bool is_connected_; // True iff is connected to an ...
10 years, 1 month ago (2010-11-06 04:05:20 UTC) #27
Paweł Hajdan Jr.
This is going in a good direction. Thank you for the work on that and ...
10 years, 1 month ago (2010-11-06 12:17:59 UTC) #28
dtu
Made changes in accordance with comments. Modified UITestBase so that CreateAutomationProxy() is defined in ProxyLauncher ...
10 years, 1 month ago (2010-11-09 04:41:52 UTC) #29
Paweł Hajdan Jr.
http://codereview.chromium.org/4202004/diff/179001/180007 File chrome/common/automation_constants.h (right): http://codereview.chromium.org/4202004/diff/179001/180007#newcode24 chrome/common/automation_constants.h:24: } On 2010/11/09 04:41:53, Dave Tu wrote: > On ...
10 years, 1 month ago (2010-11-09 19:03:20 UTC) #30
dtu
The lint error is: "Blank line at the end of a code block. Is this ...
10 years, 1 month ago (2010-11-09 21:02:28 UTC) #31
Paweł Hajdan Jr.
http://codereview.chromium.org/4202004/diff/222003/chrome/browser/ui/browser_init.cc File chrome/browser/ui/browser_init.cc (right): http://codereview.chromium.org/4202004/diff/222003/chrome/browser/ui/browser_init.cc#newcode1038 chrome/browser/ui/browser_init.cc:1038: DCHECK(list); nit: Remove pointless DCHECK. It was there before, ...
10 years, 1 month ago (2010-11-10 11:15:44 UTC) #32
jam
ipc parts should go to one of the people who worked on the posix version ...
10 years, 1 month ago (2010-11-10 17:02:41 UTC) #33
dtu
-jabdelmalek -jam +agl for changes to ipc_channel_posix.cc, ipc_channel.h On 2010/11/10 17:02:41, John Abd-El-Malek wrote: > ...
10 years, 1 month ago (2010-11-10 19:16:57 UTC) #34
agl
ipc_channel_posix.cc, ipc_channel.h: LGTM
10 years, 1 month ago (2010-11-10 19:58:21 UTC) #35
dtu
This is taking too long. I know there is a time zone difference, but the ...
10 years, 1 month ago (2010-11-11 00:10:54 UTC) #36
Paweł Hajdan Jr.
On Thu, Nov 11, 2010 at 01:10, <dtu@chromium.org> wrote: > Those functions (and their helper ...
10 years, 1 month ago (2010-11-11 10:22:17 UTC) #37
Nirnimesh
It's incredible how long this CL has dragged on. We need to iterate early and ...
10 years, 1 month ago (2010-11-11 11:20:45 UTC) #38
Paweł Hajdan Jr.
On Thu, Nov 11, 2010 at 12:20, <nirnimesh@chromium.org> wrote: > It's incredible how long this ...
10 years, 1 month ago (2010-11-11 18:07:44 UTC) #39
krisr
Pawel, It looks like your requests are becoming too large for this CL and possibly ...
10 years, 1 month ago (2010-11-11 18:13:15 UTC) #40
Paweł Hajdan Jr.
On Thu, Nov 11, 2010 at 19:13, Kris Rambish <krisr@chromium.org> wrote: > It looks like ...
10 years, 1 month ago (2010-11-11 18:22:30 UTC) #41
krisr
On Thu, Nov 11, 2010 at 10:21 AM, Paweł Hajdan, Jr. <phajdan.jr@chromium.org > wrote: > ...
10 years, 1 month ago (2010-11-11 18:32:21 UTC) #42
Nirnimesh
> > No, I disagree. We do NOT want this class to start looking like ...
10 years, 1 month ago (2010-11-11 18:39:41 UTC) #43
Paweł Hajdan Jr.
On Thu, Nov 11, 2010 at 19:32, Kris Rambish <krisr@chromium.org> wrote: > If the refactors ...
10 years, 1 month ago (2010-11-11 23:08:19 UTC) #44
John Grabowski
If you add the test described in named_interface_uitest.cc, LGTM. http://codereview.chromium.org/4202004/diff/252003/chrome/browser/automation/automation_provider.h File chrome/browser/automation/automation_provider.h (right): http://codereview.chromium.org/4202004/diff/252003/chrome/browser/automation/automation_provider.h#newcode422 chrome/browser/automation/automation_provider.h:422: ...
10 years, 1 month ago (2010-11-12 23:32:53 UTC) #45
dtu
http://codereview.chromium.org/4202004/diff/252003/chrome/browser/automation/automation_provider.h File chrome/browser/automation/automation_provider.h (right): http://codereview.chromium.org/4202004/diff/252003/chrome/browser/automation/automation_provider.h#newcode422 chrome/browser/automation/automation_provider.h:422: bool initial_loads_complete_; On 2010/11/12 23:32:53, John Grabowski wrote: > ...
10 years, 1 month ago (2010-11-16 01:30:40 UTC) #46
John Grabowski
LGTM http://codereview.chromium.org/4202004/diff/252003/chrome/test/ui/named_interface_uitest.cc File chrome/test/ui/named_interface_uitest.cc (right): http://codereview.chromium.org/4202004/diff/252003/chrome/test/ui/named_interface_uitest.cc#newcode37 chrome/test/ui/named_interface_uitest.cc:37: On 2010/11/16 01:30:40, Dave Tu wrote: > On ...
10 years, 1 month ago (2010-11-16 01:33:03 UTC) #47
Paweł Hajdan Jr.
Please note that according to http://www.chromium.org/developers/committers-responsibility there are several issues that must be fixed before ...
10 years, 1 month ago (2010-11-16 09:44:49 UTC) #48
Paweł Hajdan Jr.
On Wed, Nov 17, 2010 at 09:25, John Grabowski <jrg@chromium.org> wrote: > -cc chromium-reviews > ...
10 years, 1 month ago (2010-11-17 09:07:07 UTC) #49
Paweł Hajdan Jr.
Yesterday we've chatted about this review, and I'd suggest scheduling regular chats for review sessions ...
10 years, 1 month ago (2010-11-18 06:48:15 UTC) #50
dtu
+amit, there are some minor changes to chrome frame automation that seemed to cause test ...
10 years, 1 month ago (2010-11-19 02:10:49 UTC) #51
amit
Overall changes look OK as far as Chrome Frame is concerned. http://codereview.chromium.org/4202004/diff/527003/chrome/test/automation/automation_proxy_uitest.cc File chrome/test/automation/automation_proxy_uitest.cc (right): ...
10 years, 1 month ago (2010-11-19 18:27:10 UTC) #52
dtu
http://codereview.chromium.org/4202004/diff/527003/chrome/test/automation/automation_proxy_uitest.cc File chrome/test/automation/automation_proxy_uitest.cc (right): http://codereview.chromium.org/4202004/diff/527003/chrome/test/automation/automation_proxy_uitest.cc#newcode873 chrome/test/automation/automation_proxy_uitest.cc:873: return new ExternalTabUITestMockLauncher(&mock_); On 2010/11/19 18:27:10, amit wrote: > ...
10 years, 1 month ago (2010-11-19 19:37:08 UTC) #53
Paweł Hajdan Jr.
I've just chatted with Nirnimesh about this CL. Feel free to land, provided the issue ...
10 years, 1 month ago (2010-11-23 20:57:20 UTC) #54
dtu
Thanks guys for resolving that dispute. If everyone is fine with the latest patch set, ...
10 years, 1 month ago (2010-11-24 06:29:22 UTC) #55
amit
10 years, 1 month ago (2010-11-24 13:04:28 UTC) #56
ok

On Tue, Nov 23, 2010 at 10:29 PM, <dtu@chromium.org> wrote:

> Thanks guys for resolving that dispute. If everyone is fine with the latest
> patch set, it passes all the tries and is ready to land. I'm looking
> forward to
> it.
>
>
>
>
>
http://codereview.chromium.org/4202004/diff/527003/chrome/test/automation/aut...
> File chrome/test/automation/automation_proxy_uitest.cc (right):
>
>
>
http://codereview.chromium.org/4202004/diff/527003/chrome/test/automation/aut...
> chrome/test/automation/automation_proxy_uitest.cc:873: return new
> ExternalTabUITestMockLauncher(&mock_);
> On 2010/11/19 19:37:08, Dave Tu wrote:
>
>> On 2010/11/19 18:27:10, amit wrote:
>> > Ugg! Is there any better way to do this?
>> > It's not ideal but perhaps ExternalTabUITest could implement a
>>
> ProxyLauncher.
>
>  Good idea. Even if it's not ideal it's better than this mess.
>>
>
> Actually, it's not working, which i think is because UITest creates a
> scoped_ptr for its ProxyLauncher, and it crashes during cleanup when the
> pointer goes out of scope.
>
>
> http://codereview.chromium.org/4202004/
>

Powered by Google App Engine