|
|
Chromium Code Reviews|
Created:
3 years, 7 months ago by leonhsl(Using Gerrit) Modified:
3 years, 6 months ago CC:
chromium-reviews, darin-cc_chromium.org Target Ref:
refs/heads/master Project:
chromium Visibility:
Public. |
Description[DeviceService] Add end-to-end browsertest for PowerMonitor
This CL is to confirm that in a real browser environment the renderer
process CAN succeed in connecting to Device Service to bind PowerMonitor
interface, and, via which renderer process CAN get power state change
correctly.
Follow-up CL will set up similar tests for gpu/utility child processes.
BUG=715985
TEST=content_browsertests
Review-Url: https://codereview.chromium.org/2870373002
Cr-Commit-Position: refs/heads/master@{#478928}
Committed: https://chromium.googlesource.com/chromium/src/+/a0c5fa3e6bb48c503df220d9c8ac946598f12215
Patch Set 1 #Patch Set 2 : Rebase only #Patch Set 3 : Add mojo interface for test to get power state of child processes #
Total comments: 8
Patch Set 4 : Rebase only #Patch Set 5 : Address comments from jam@ and blundell@ #
Messages
Total messages: 63 (41 generated)
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [DeviceService] Add end-to-end browsertest for PowerMonitor BUG=715985 TEST=content_browsertests ========== to ========== [DeviceService] Add end-to-end browsertest for PowerMonitor This CL is to confirm that in a real browser environment the browser child process CAN succeed in connecting to Device Service to bind PowerMonitor interface. BUG=715985 TEST=content_browsertests ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
leon.han@intel.com changed reviewers: + blundell@chromium.org
Hi, Colin, this CL just adds a end-to-end test for renderer process, I tried to also cover other child processes(gpu etc.), but content_browsertests seems does not start gpu process on startup, and I'm not clear how to trigger starting it. And starting utility/plugin process also needs additional work. As all these child processes share the same ChildThreadImpl implementation, maybe this CL is enough now? I'm eager to your suggestions/comments:) Thanks.
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #1 (id:1) has been deleted
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
This is a great start! It would be great if we could add tests that would catch both the regressions that we've seen. I believe that this test would catch the second (where ChildThreadImpl was working with an empty InterfaceProvider), but not the first (where the client didn't hold on to the PowerMonitor connection, causing the PowerMonitor impl to immediately die). Is that correct? Also, it would indeed be great to add another process type, but I don't know anything about doing that in a browsertest. jam@ is likely a good starting point there. We shouldn't let that block us getting these tests in though for sure.
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2017/05/10 14:54:56, blundell wrote: > This is a great start! It would be great if we could add tests that would catch > both the regressions that we've seen. I believe that this test would catch the > second (where ChildThreadImpl was working with an empty InterfaceProvider), but > not the first (where the client didn't hold on to the PowerMonitor connection, > causing the PowerMonitor impl to immediately die). Is that correct? > The first regression we met before is caused by internal implementation of the PowerMonitor impl, the client would connect to PowerMonitor, just call AddClient() on it and then close PowerMonitor connection, this is expected behavior, while PowerMonitor impl should not have used StrongBinding to put its lifecycle controlled by this mojo connection. So I think the service test in power_monitor_message_broadcaster_unittest.cc should be able to catch such regression now. But it's true that the service test can NOT catch the error that under real browser environment ChildThreadImpl may not hold PowerMonitorClient impl correctly(not long enough, so that child processes can't get power monitor notifications correctly), I'll consider more about how to verify this happening inside child processes.. Power monitor has no corresponding javascript APIs just like battery/vibration to enable us to confirm some information via html/javascript..
leon.han@intel.com changed reviewers: + jam@chromium.org
Hi, John, we want to start up some child processes like gpu/utility/plugin in a browser test, to verify some behavior inside our Device Service, do you have any idea how to achieve this? Some samples in existing browser tests will be very helpful :-) Thanks!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/05/11 03:38:14, leonhsl wrote: > Hi, John, we want to start up some child processes like gpu/utility/plugin in a > browser test, to verify some behavior inside our Device Service, do you have any > idea how to achieve this? Some samples in existing browser tests will be very > helpful :-) Thanks! Can you provide more information? What do you want to run in the child process?
On 2017/05/11 14:55:23, jam wrote: > On 2017/05/11 03:38:14, leonhsl wrote: > > Hi, John, we want to start up some child processes like gpu/utility/plugin in > a > > browser test, to verify some behavior inside our Device Service, do you have > any > > idea how to achieve this? Some samples in existing browser tests will be very > > helpful :-) Thanks! > > Can you provide more information? What do you want to run in the child process? We want to verify the following 2 behaviors: 1. Child processes(renderer/gpu/utility/plugin) on startup SHOULD&CAN bind PowerMonitor interface to Device Service. 2. Child processes CAN receive power change notifications when power status changed in browser process. Above 1 only requires to start these child processes from a browser test, ps#2 of this CL just starts a renderer process to verify this, but I have no idea how to start other child processes in browser test. Above 2 requires to pick&verify some power related information of child process from a browser test.
On 2017/05/12 00:44:46, leonhsl wrote:
> On 2017/05/11 14:55:23, jam wrote:
> > On 2017/05/11 03:38:14, leonhsl wrote:
> > > Hi, John, we want to start up some child processes like gpu/utility/plugin
> in
> > a
> > > browser test, to verify some behavior inside our Device Service, do you
have
> > any
> > > idea how to achieve this? Some samples in existing browser tests will be
> very
> > > helpful :-) Thanks!
> >
> > Can you provide more information? What do you want to run in the child
> process?
>
> We want to verify the following 2 behaviors:
> 1. Child processes(renderer/gpu/utility/plugin) on startup SHOULD&CAN bind
> PowerMonitor interface to Device Service.
> 2. Child processes CAN receive power change notifications when power status
> changed in browser process.
>
> Above 1 only requires to start these child processes from a browser test, ps#2
> of this CL just starts a renderer process to verify this, but I have no idea
how
> to start other child processes in browser test.
> Above 2 requires to pick&verify some power related information of child
process
> from a browser test.
Got it, so the way to do this would be to define some test IPCs. we really only
have old IPC in content/shell/common/shell_messages.h, but you should create a
new shell_messages.mojom for this (cause we should avoid creating new IPCs to
test mojo code!). Then you can write code in content/shell/{utility, gpu,
renderer} to dispatch these messages and send back verification.
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Hi, Colin, John, now ps#3 can verify power state change of renderer process by adding the new mojo interface PowerMonitorTest, PTAnL, Thanks!
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
Thanks, this looks great! https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... File content/browser/power_monitor_browsertest.cc (right): https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... content/browser/power_monitor_browsertest.cc:111: IN_PROC_BROWSER_TEST_F(PowerMonitorTest, RequestOnceFromOneRendererProcess) { John, would we able to set up a similar test for the GPU/utility processes? https://codereview.chromium.org/2870373002/diff/60001/content/public/test/pow... File content/public/test/power_monitor_test.mojom (right): https://codereview.chromium.org/2870373002/diff/60001/content/public/test/pow... content/public/test/power_monitor_test.mojom:7: interface PowerMonitorTest { nit: This could use a comment.
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... File content/browser/power_monitor_browsertest.cc (right): https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... content/browser/power_monitor_browsertest.cc:111: IN_PROC_BROWSER_TEST_F(PowerMonitorTest, RequestOnceFromOneRendererProcess) { On 2017/05/16 13:28:42, blundell wrote: > John, would we able to set up a similar test for the GPU/utility processes? Friendly ping John, how could we start up GPU/utility processes in content browsertests? Thanks.
On 2017/05/22 12:11:57, leonhsl wrote: > https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... > File content/browser/power_monitor_browsertest.cc (right): > > https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... > content/browser/power_monitor_browsertest.cc:111: > IN_PROC_BROWSER_TEST_F(PowerMonitorTest, RequestOnceFromOneRendererProcess) { > On 2017/05/16 13:28:42, blundell wrote: > > John, would we able to set up a similar test for the GPU/utility processes? > > Friendly ping John, how could we start up GPU/utility processes in content > browsertests? Thanks. I think we could also land this CL as-is and take that discussion to a bug for a followup.
On 2017/05/22 12:14:52, blundell wrote: > On 2017/05/22 12:11:57, leonhsl wrote: > > > https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... > > File content/browser/power_monitor_browsertest.cc (right): > > > > > https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... > > content/browser/power_monitor_browsertest.cc:111: > > IN_PROC_BROWSER_TEST_F(PowerMonitorTest, RequestOnceFromOneRendererProcess) { > > On 2017/05/16 13:28:42, blundell wrote: > > > John, would we able to set up a similar test for the GPU/utility processes? > > > > Friendly ping John, how could we start up GPU/utility processes in content > > browsertests? Thanks. > > I think we could also land this CL as-is and take that discussion to a bug for a > followup. Hi, Colin, I agree we proceed step by step, and CCd John about this in original issue crbug.com/715985. Hi, John, PTAL at this CL firstly, so we can at least get one browsertest ready to defend against potential regressions which have happened before ;-)
Friendly ping John, Thanks.
really sorry for the delay, I missed this. please IM or send me direct emails if I don't respond quickly. https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... File content/browser/power_monitor_browsertest.cc (right): https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... content/browser/power_monitor_browsertest.cc:111: IN_PROC_BROWSER_TEST_F(PowerMonitorTest, RequestOnceFromOneRendererProcess) { On 2017/05/22 12:11:57, leonhsl (OOO until 09 June) wrote: > On 2017/05/16 13:28:42, blundell wrote: > > John, would we able to set up a similar test for the GPU/utility processes? > > Friendly ping John, how could we start up GPU/utility processes in content > browsertests? Thanks. Since the GPU process is always running, content/shell can also add embedder interfaces in the GPU process to respond to testing IPCs. For utility, also do the same. https://codereview.chromium.org/2870373002/diff/60001/content/public/test/pow... File content/public/test/power_monitor_test.mojom (right): https://codereview.chromium.org/2870373002/diff/60001/content/public/test/pow... content/public/test/power_monitor_test.mojom:7: interface PowerMonitorTest { nit: move this to content/shell/common
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== [DeviceService] Add end-to-end browsertest for PowerMonitor This CL is to confirm that in a real browser environment the browser child process CAN succeed in connecting to Device Service to bind PowerMonitor interface. BUG=715985 TEST=content_browsertests ========== to ========== [DeviceService] Add end-to-end browsertest for PowerMonitor This CL is to confirm that in a real browser environment the renderer process CAN succeed in connecting to Device Service to bind PowerMonitor interface, and, via which renderer process CAN get power state change correctly. BUG=715985 TEST=content_browsertests ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: android_n5x_swarming_rel on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/android_n5x_...) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by leon.han@intel.com to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Patchset #5 (id:100001) has been deleted
Description was changed from ========== [DeviceService] Add end-to-end browsertest for PowerMonitor This CL is to confirm that in a real browser environment the renderer process CAN succeed in connecting to Device Service to bind PowerMonitor interface, and, via which renderer process CAN get power state change correctly. BUG=715985 TEST=content_browsertests ========== to ========== [DeviceService] Add end-to-end browsertest for PowerMonitor This CL is to confirm that in a real browser environment the renderer process CAN succeed in connecting to Device Service to bind PowerMonitor interface, and, via which renderer process CAN get power state change correctly. Follow-up CL will set up similar tests for gpu/utility child processes. BUG=715985 TEST=content_browsertests ==========
Hi, John, Colin, PTAnL at ps#5, Thanks! https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... File content/browser/power_monitor_browsertest.cc (right): https://codereview.chromium.org/2870373002/diff/60001/content/browser/power_m... content/browser/power_monitor_browsertest.cc:111: IN_PROC_BROWSER_TEST_F(PowerMonitorTest, RequestOnceFromOneRendererProcess) { On 2017/06/06 22:20:28, jam wrote: > On 2017/05/22 12:11:57, leonhsl (OOO until 09 June) wrote: > > On 2017/05/16 13:28:42, blundell wrote: > > > John, would we able to set up a similar test for the GPU/utility processes? > > > > Friendly ping John, how could we start up GPU/utility processes in content > > browsertests? Thanks. > > Since the GPU process is always running, content/shell can also add embedder > interfaces in the GPU process to respond to testing IPCs. For utility, also do > the same. Thanks! I'd like to land this CL(only for renderer process) firstly, then investigate more and set up similar tests for gpu/utility with follow-up CL. https://codereview.chromium.org/2870373002/diff/60001/content/public/test/pow... File content/public/test/power_monitor_test.mojom (right): https://codereview.chromium.org/2870373002/diff/60001/content/public/test/pow... content/public/test/power_monitor_test.mojom:7: interface PowerMonitorTest { On 2017/06/06 22:20:28, jam wrote: > nit: move this to content/shell/common Done. https://codereview.chromium.org/2870373002/diff/60001/content/public/test/pow... content/public/test/power_monitor_test.mojom:7: interface PowerMonitorTest { On 2017/05/16 13:28:42, blundell wrote: > nit: This could use a comment. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
lgtm
The CQ bit was checked by leon.han@intel.com
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
leon.han@intel.com changed reviewers: + mkwst@chromium.org
Hi, Mike, would you please help to take an OWNER review for adding content/shell/common/power_monitor_test.mojom? Thanks.
mojo LGTM.
The CQ bit was checked by leon.han@intel.com
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 120001, "attempt_start_ts": 1497339950355220,
"parent_rev": "22e5033f53dfb9e1e5792aad8bfec89d19afc5fc", "commit_rev":
"a0c5fa3e6bb48c503df220d9c8ac946598f12215"}
Message was sent while issue was closed.
Description was changed from ========== [DeviceService] Add end-to-end browsertest for PowerMonitor This CL is to confirm that in a real browser environment the renderer process CAN succeed in connecting to Device Service to bind PowerMonitor interface, and, via which renderer process CAN get power state change correctly. Follow-up CL will set up similar tests for gpu/utility child processes. BUG=715985 TEST=content_browsertests ========== to ========== [DeviceService] Add end-to-end browsertest for PowerMonitor This CL is to confirm that in a real browser environment the renderer process CAN succeed in connecting to Device Service to bind PowerMonitor interface, and, via which renderer process CAN get power state change correctly. Follow-up CL will set up similar tests for gpu/utility child processes. BUG=715985 TEST=content_browsertests Review-Url: https://codereview.chromium.org/2870373002 Cr-Commit-Position: refs/heads/master@{#478928} Committed: https://chromium.googlesource.com/chromium/src/+/a0c5fa3e6bb48c503df220d9c8ac... ==========
Message was sent while issue was closed.
Committed patchset #5 (id:120001) as https://chromium.googlesource.com/chromium/src/+/a0c5fa3e6bb48c503df220d9c8ac... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
