Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Issue 10837082: implement SetWatchEvent and WaitForEvent for trace-based-tests (Closed)

Created:
8 years, 4 months ago by jbates
Modified:
8 years, 3 months ago
CC:
chromium-reviews, nduca, Paweł Hajdan Jr.
Visibility:
Public.

Description

implement SetWatchEvent and WaitForEvent for trace-based-tests. Up until now, tracing-based tests have been required to either run a trace for some amount of time or use existing notification mechanisms to return control to the test. This change adds a 'watch event' feature to trace_event_impl which can be used by tests to wait for an event to occur. This mechanism could replace the use of test-only notifications which is frowned upon as well as mock classes for catching events. Trace events also have the huge advantage of working on all chrome processes as opposed to the browser-only notification service. BUG=139939 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=154552

Patch Set 1 #

Patch Set 2 : added tests #

Patch Set 3 : cleaned up and fixed a bug #

Total comments: 14

Patch Set 4 : ccameron feedback #

Patch Set 5 : added test for child process events #

Patch Set 6 : nduca feedback: support a global wakeup count from all processes #

Patch Set 7 : fix trace_event_unittests #

Total comments: 12

Patch Set 8 : sky, piman feedback #

Total comments: 16

Patch Set 9 : jar feedback #

Total comments: 4

Patch Set 10 : jar feedback #

Patch Set 11 : jar feedback #

Patch Set 12 : jar feedback - deadlock fixed #

Patch Set 13 : remove unused destructor code from TraceControllerImpl #

Patch Set 14 : update / merge -- no change #

Unified diffs Side-by-side diffs Delta from patch set Stats (+626 lines, -162 lines) Patch
M base/debug/trace_event_impl.h View 1 2 3 4 5 6 7 8 9 10 11 8 chunks +62 lines, -15 lines 0 comments Download
M base/debug/trace_event_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +105 lines, -50 lines 0 comments Download
M base/debug/trace_event_unittest.cc View 1 2 3 4 5 6 30 chunks +114 lines, -38 lines 0 comments Download
M base/test/trace_event_analyzer_unittest.cc View 1 2 3 2 chunks +4 lines, -5 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -0 lines 0 comments Download
M chrome/test/base/tracing.h View 1 2 3 4 5 6 7 2 chunks +21 lines, -3 lines 0 comments Download
M chrome/test/base/tracing.cc View 1 2 3 4 5 6 7 8 9 3 chunks +77 lines, -3 lines 0 comments Download
A chrome/test/base/tracing_browsertest.cc View 1 2 3 4 5 1 chunk +88 lines, -0 lines 0 comments Download
M content/browser/trace_controller_impl.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +9 lines, -3 lines 0 comments Download
M content/browser/trace_controller_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +63 lines, -14 lines 0 comments Download
M content/browser/trace_message_filter.h View 1 2 3 4 5 2 chunks +4 lines, -1 line 0 comments Download
M content/browser/trace_message_filter.cc View 1 2 3 4 5 3 chunks +13 lines, -4 lines 0 comments Download
M content/common/child_process_messages.h View 1 2 3 4 5 2 chunks +10 lines, -1 line 0 comments Download
M content/common/child_trace_message_filter.h View 1 2 3 4 5 1 chunk +4 lines, -1 line 0 comments Download
M content/common/child_trace_message_filter.cc View 1 2 3 4 5 4 chunks +34 lines, -23 lines 0 comments Download
M content/public/browser/trace_controller.h View 1 2 3 4 5 6 7 1 chunk +10 lines, -0 lines 0 comments Download
M content/public/browser/trace_subscriber.h View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M content/renderer/render_view_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 25 (0 generated)
jbates
8 years, 4 months ago (2012-08-03 00:32:08 UTC) #1
jbates
ptal
8 years, 4 months ago (2012-08-05 20:43:08 UTC) #2
jbates
ptal
8 years, 4 months ago (2012-08-07 23:32:14 UTC) #3
ccameron
http://codereview.chromium.org/10837082/diff/8001/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): http://codereview.chromium.org/10837082/diff/8001/base/debug/trace_event_impl.cc#newcode333 base/debug/trace_event_impl.cc:333: ++trace_log_->notification_thread_count_; [RW-lock evangelism]: With a separate reader-writer lock for ...
8 years, 4 months ago (2012-08-21 01:06:34 UTC) #4
jbates
Latest CL adds a browsertest for the new tracing::WaitForWatchEvent API. I'd like to hold off ...
8 years, 4 months ago (2012-08-23 22:45:28 UTC) #5
jbates
ccameron: lg?
8 years, 4 months ago (2012-08-24 18:54:51 UTC) #6
ccameron
On 2012/08/24 18:54:51, jbates wrote: > ccameron: lg? lgtm
8 years, 4 months ago (2012-08-24 20:00:18 UTC) #7
jbates
brettw: */OWNERS
8 years, 4 months ago (2012-08-24 20:23:45 UTC) #8
brettw
overloaded, please find another reviewer.
8 years, 3 months ago (2012-08-29 06:54:36 UTC) #9
jbates
Owners, ptal. jar: base/OWNERS sky: chrome/test/OWNERS piman: content/OWNERS
8 years, 3 months ago (2012-08-29 15:50:36 UTC) #10
sky
http://codereview.chromium.org/10837082/diff/18002/chrome/test/base/tracing.cc File chrome/test/base/tracing.cc (right): http://codereview.chromium.org/10837082/diff/18002/chrome/test/base/tracing.cc#newcode27 chrome/test/base/tracing.cc:27: , watch_notification_count_(0) {} , on previous line. http://codereview.chromium.org/10837082/diff/18002/chrome/test/base/tracing.cc#newcode106 chrome/test/base/tracing.cc:106: ...
8 years, 3 months ago (2012-08-29 16:05:09 UTC) #11
piman
LGTM+nit http://codereview.chromium.org/10837082/diff/18002/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): http://codereview.chromium.org/10837082/diff/18002/base/debug/trace_event_impl.h#newcode229 base/debug/trace_event_impl.h:229: // time. After calling SetNotificationCallback(NotificationCallback()) to nit: please ...
8 years, 3 months ago (2012-08-29 16:50:07 UTC) #12
jbates
http://codereview.chromium.org/10837082/diff/18002/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): http://codereview.chromium.org/10837082/diff/18002/base/debug/trace_event_impl.h#newcode229 base/debug/trace_event_impl.h:229: // time. After calling SetNotificationCallback(NotificationCallback()) to On 2012/08/29 16:50:07, ...
8 years, 3 months ago (2012-08-29 21:14:12 UTC) #13
piman
All your base LGTM
8 years, 3 months ago (2012-08-29 21:27:34 UTC) #14
sky
LGTM
8 years, 3 months ago (2012-08-29 21:40:46 UTC) #15
jar (doing other things)
http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.cc#newcode323 base/debug/trace_event_impl.cc:323: , notification_(0) { nit: comma on end of previous ...
8 years, 3 months ago (2012-08-29 22:38:19 UTC) #16
jbates
http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.cc File base/debug/trace_event_impl.cc (right): http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.cc#newcode323 base/debug/trace_event_impl.cc:323: , notification_(0) { On 2012/08/29 22:38:19, jar wrote: > ...
8 years, 3 months ago (2012-08-29 23:12:06 UTC) #17
jar (doing other things)
http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.h#newcode231 base/debug/trace_event_impl.h:231: // is guaranteed that the old callback will no ...
8 years, 3 months ago (2012-08-29 23:35:45 UTC) #18
jbates
http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.h File base/debug/trace_event_impl.h (right): http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.h#newcode231 base/debug/trace_event_impl.h:231: // is guaranteed that the old callback will no ...
8 years, 3 months ago (2012-08-30 00:55:14 UTC) #19
jbates
On 2012/08/30 00:55:14, jbates wrote: > http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.h > File base/debug/trace_event_impl.h (right): > > http://codereview.chromium.org/10837082/diff/27002/base/debug/trace_event_impl.h#newcode231 > ...
8 years, 3 months ago (2012-08-30 20:22:31 UTC) #20
jar (doing other things)
Base changes LGTM
8 years, 3 months ago (2012-08-30 23:20:16 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jbates@chromium.org/10837082/50001
8 years, 3 months ago (2012-08-30 23:22:51 UTC) #22
commit-bot: I haz the power
Failed to apply patch for content/renderer/render_view_impl.cc: While running patch -p1 --forward --force; patching file content/renderer/render_view_impl.cc ...
8 years, 3 months ago (2012-08-30 23:22:59 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/jbates@chromium.org/10837082/49004
8 years, 3 months ago (2012-08-31 21:44:01 UTC) #24
commit-bot: I haz the power
8 years, 3 months ago (2012-09-01 00:52:21 UTC) #25
Change committed as 154552

Powered by Google App Engine
This is Rietveld 408576698