| 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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 virtual void SetUp() { | 87 virtual void SetUp() { |
| 88 // Cleanup any potentially dangling sessions. | 88 // Cleanup any potentially dangling sessions. |
| 89 EtwTraceProperties ignore; | 89 EtwTraceProperties ignore; |
| 90 EtwTraceController::Stop(session_name_.c_str(), &ignore); | 90 EtwTraceController::Stop(session_name_.c_str(), &ignore); |
| 91 | 91 |
| 92 // Allocate a new GUID for each provider test. | 92 // Allocate a new GUID for each provider test. |
| 93 ASSERT_HRESULT_SUCCEEDED(::CoCreateGuid(&test_provider_)); | 93 ASSERT_HRESULT_SUCCEEDED(::CoCreateGuid(&test_provider_)); |
| 94 } | 94 } |
| 95 | 95 |
| 96 virtual void TearDown() { | 96 virtual void TearDown() { |
| 97 // Cleanup any potentially danging sessions. | 97 // Cleanup any potentially dangling sessions. |
| 98 EtwTraceProperties ignore; | 98 EtwTraceProperties ignore; |
| 99 EtwTraceController::Stop(session_name_.c_str(), &ignore); | 99 EtwTraceController::Stop(session_name_.c_str(), &ignore); |
| 100 } | 100 } |
| 101 | 101 |
| 102 protected: | 102 protected: |
| 103 GUID test_provider_; | 103 GUID test_provider_; |
| 104 std::wstring session_name_; | 104 std::wstring session_name_; |
| 105 }; | 105 }; |
| 106 | 106 |
| 107 } // namespace | 107 } // namespace |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 return; | 374 return; |
| 375 } | 375 } |
| 376 ASSERT_HRESULT_SUCCEEDED(hr) << "RoundTripEvent failed"; | 376 ASSERT_HRESULT_SUCCEEDED(hr) << "RoundTripEvent failed"; |
| 377 ASSERT_TRUE(NULL != trace); | 377 ASSERT_TRUE(NULL != trace); |
| 378 ASSERT_EQ(sizeof(kData), trace->MofLength); | 378 ASSERT_EQ(sizeof(kData), trace->MofLength); |
| 379 ASSERT_STREQ(kData, reinterpret_cast<const char*>(trace->MofData)); | 379 ASSERT_STREQ(kData, reinterpret_cast<const char*>(trace->MofData)); |
| 380 } | 380 } |
| 381 | 381 |
| 382 } // namespace win | 382 } // namespace win |
| 383 } // namespace base | 383 } // namespace base |
| OLD | NEW |