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

Side by Side Diff: base/win/event_trace_consumer_unittest.cc

Issue 10386141: Fix EtwTraceConsumerRealtimeTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Enable the test Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // Unit tests for event trace consumer base class. 5 // Unit tests for event trace consumer base class.
6 #include "base/win/event_trace_consumer.h" 6 #include "base/win/event_trace_consumer.h"
7 7
8 #include <list> 8 #include <list>
9 9
10 #include <objbase.h> 10 #include <objbase.h>
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 return HRESULT_FROM_WIN32(::GetLastError()); 199 return HRESULT_FROM_WIN32(::GetLastError());
200 200
201 DWORD exit_code = 0; 201 DWORD exit_code = 0;
202 if (::GetExitCodeThread(consumer_thread_, &exit_code)) 202 if (::GetExitCodeThread(consumer_thread_, &exit_code))
203 return exit_code; 203 return exit_code;
204 204
205 return HRESULT_FROM_WIN32(::GetLastError()); 205 return HRESULT_FROM_WIN32(::GetLastError());
206 } 206 }
207 207
208 TestConsumer consumer_; 208 TestConsumer consumer_;
209 GUID test_provider_;
210 base::win::ScopedHandle consumer_ready_; 209 base::win::ScopedHandle consumer_ready_;
211 base::win::ScopedHandle consumer_thread_; 210 base::win::ScopedHandle consumer_thread_;
212 }; 211 };
213 212
214 } // namespace 213 } // namespace
215 214
216 TEST_F(EtwTraceConsumerRealtimeTest, ConsumerReturnsWhenSessionClosed) { 215 TEST_F(EtwTraceConsumerRealtimeTest, ConsumerReturnsWhenSessionClosed) {
217 EtwTraceController controller; 216 EtwTraceController controller;
218 217
219 HRESULT hr = controller.StartRealtimeSession(session_name_.c_str(), 218 HRESULT hr = controller.StartRealtimeSession(session_name_.c_str(),
(...skipping 16 matching lines...) Expand all
236 } 235 }
237 236
238 namespace { 237 namespace {
239 238
240 // {57E47923-A549-476f-86CA-503D57F59E62} 239 // {57E47923-A549-476f-86CA-503D57F59E62}
241 DEFINE_GUID(kTestEventType, 240 DEFINE_GUID(kTestEventType,
242 0x57e47923, 0xa549, 0x476f, 0x86, 0xca, 0x50, 0x3d, 0x57, 0xf5, 0x9e, 0x62); 241 0x57e47923, 0xa549, 0x476f, 0x86, 0xca, 0x50, 0x3d, 0x57, 0xf5, 0x9e, 0x62);
243 242
244 } // namespace 243 } // namespace
245 244
246 // Fails consistently on Vista. http://crbug.com/127671 245 TEST_F(EtwTraceConsumerRealtimeTest, ConsumeEvent) {
247 TEST_F(EtwTraceConsumerRealtimeTest, DISABLED_ConsumeEvent) {
248 EtwTraceController controller; 246 EtwTraceController controller;
249 HRESULT hr = controller.StartRealtimeSession(session_name_.c_str(), 247 HRESULT hr = controller.StartRealtimeSession(session_name_.c_str(),
250 100 * 1024); 248 100 * 1024);
251 if (hr == E_ACCESSDENIED) { 249 if (hr == E_ACCESSDENIED) {
252 VLOG(1) << "You must be an administrator to run this test on Vista"; 250 VLOG(1) << "You must be an administrator to run this test on Vista";
253 return; 251 return;
254 } 252 }
255 253
256 ASSERT_HRESULT_SUCCEEDED(controller.EnableProvider(test_provider_, 254 ASSERT_HRESULT_SUCCEEDED(controller.EnableProvider(test_provider_,
257 TRACE_LEVEL_VERBOSE, 0xFFFFFFFF)); 255 TRACE_LEVEL_VERBOSE, 0xFFFFFFFF));
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 HRESULT hr = RoundTripEvent(&event.header, &trace); 372 HRESULT hr = RoundTripEvent(&event.header, &trace);
375 if (hr == E_ACCESSDENIED) { 373 if (hr == E_ACCESSDENIED) {
376 VLOG(1) << "You must be an administrator to run this test on Vista"; 374 VLOG(1) << "You must be an administrator to run this test on Vista";
377 return; 375 return;
378 } 376 }
379 ASSERT_HRESULT_SUCCEEDED(hr) << "RoundTripEvent failed"; 377 ASSERT_HRESULT_SUCCEEDED(hr) << "RoundTripEvent failed";
380 ASSERT_TRUE(NULL != trace); 378 ASSERT_TRUE(NULL != trace);
381 ASSERT_EQ(sizeof(kData), trace->MofLength); 379 ASSERT_EQ(sizeof(kData), trace->MofLength);
382 ASSERT_STREQ(kData, reinterpret_cast<const char*>(trace->MofData)); 380 ASSERT_STREQ(kData, reinterpret_cast<const char*>(trace->MofData));
383 } 381 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698