| OLD | NEW |
| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 void SetUp() override { | 265 void SetUp() override { |
| 266 EtwTraceConsumerBaseTest::SetUp(); | 266 EtwTraceConsumerBaseTest::SetUp(); |
| 267 | 267 |
| 268 EtwTraceProperties prop; | 268 EtwTraceProperties prop; |
| 269 EtwTraceController::Stop(session_name_.c_str(), &prop); | 269 EtwTraceController::Stop(session_name_.c_str(), &prop); |
| 270 | 270 |
| 271 // Create a temp dir for this test. | 271 // Create a temp dir for this test. |
| 272 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 272 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
| 273 // Construct a temp file name in our dir. | 273 // Construct a temp file name in our dir. |
| 274 temp_file_ = temp_dir_.path().Append(L"test.etl"); | 274 temp_file_ = temp_dir_.GetPath().Append(L"test.etl"); |
| 275 } | 275 } |
| 276 | 276 |
| 277 void TearDown() override { | 277 void TearDown() override { |
| 278 EXPECT_TRUE(base::DeleteFile(temp_file_, false)); | 278 EXPECT_TRUE(base::DeleteFile(temp_file_, false)); |
| 279 | 279 |
| 280 EtwTraceConsumerBaseTest::TearDown(); | 280 EtwTraceConsumerBaseTest::TearDown(); |
| 281 } | 281 } |
| 282 | 282 |
| 283 HRESULT LogEventToTempSession(PEVENT_TRACE_HEADER header) { | 283 HRESULT LogEventToTempSession(PEVENT_TRACE_HEADER header) { |
| 284 EtwTraceController controller; | 284 EtwTraceController controller; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 return; | 358 return; |
| 359 } | 359 } |
| 360 ASSERT_HRESULT_SUCCEEDED(hr) << "RoundTripEvent failed"; | 360 ASSERT_HRESULT_SUCCEEDED(hr) << "RoundTripEvent failed"; |
| 361 ASSERT_TRUE(trace != NULL); | 361 ASSERT_TRUE(trace != NULL); |
| 362 ASSERT_EQ(sizeof(kData), trace->MofLength); | 362 ASSERT_EQ(sizeof(kData), trace->MofLength); |
| 363 ASSERT_STREQ(kData, reinterpret_cast<const char*>(trace->MofData)); | 363 ASSERT_STREQ(kData, reinterpret_cast<const char*>(trace->MofData)); |
| 364 } | 364 } |
| 365 | 365 |
| 366 } // namespace win | 366 } // namespace win |
| 367 } // namespace base | 367 } // namespace base |
| OLD | NEW |