| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 controller. | 5 // Unit tests for event trace controller. |
| 6 #include "base/event_trace_controller_win.h" | 6 #include "base/win/event_trace_controller.h" |
| 7 #include "base/event_trace_provider_win.h" | 7 #include "base/win/event_trace_provider.h" |
| 8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/scoped_handle.h" | 11 #include "base/scoped_handle.h" |
| 12 #include "base/sys_info.h" | 12 #include "base/sys_info.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 #include <initguid.h> // NOLINT - must be last. | 14 #include <initguid.h> // NOLINT - must be last. |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 using base::win::EtwTraceController; |
| 19 using base::win::EtwTraceProvider; |
| 20 using base::win::EtwTraceProperties; |
| 21 |
| 18 const wchar_t kTestSessionName[] = L"TestLogSession"; | 22 const wchar_t kTestSessionName[] = L"TestLogSession"; |
| 19 | 23 |
| 20 // {0D236A42-CD18-4e3d-9975-DCEEA2106E05} | 24 // {0D236A42-CD18-4e3d-9975-DCEEA2106E05} |
| 21 DEFINE_GUID(kTestProvider, | 25 DEFINE_GUID(kTestProvider, |
| 22 0xd236a42, 0xcd18, 0x4e3d, 0x99, 0x75, 0xdc, 0xee, 0xa2, 0x10, 0x6e, 0x5); | 26 0xd236a42, 0xcd18, 0x4e3d, 0x99, 0x75, 0xdc, 0xee, 0xa2, 0x10, 0x6e, 0x5); |
| 23 | 27 |
| 24 DEFINE_GUID(kGuidNull, | 28 DEFINE_GUID(kGuidNull, |
| 25 0x0000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0); | 29 0x0000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0); |
| 26 | 30 |
| 27 const ULONG kTestProviderFlags = 0xCAFEBABE; | 31 const ULONG kTestProviderFlags = 0xCAFEBABE; |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 EXPECT_EQ(kTestProviderFlags, provider.enable_flags()); | 199 EXPECT_EQ(kTestProviderFlags, provider.enable_flags()); |
| 196 | 200 |
| 197 EXPECT_HRESULT_SUCCEEDED(controller.Stop(NULL)); | 201 EXPECT_HRESULT_SUCCEEDED(controller.Stop(NULL)); |
| 198 | 202 |
| 199 provider.WaitForCallback(); | 203 provider.WaitForCallback(); |
| 200 | 204 |
| 201 // Session should have wound down. | 205 // Session should have wound down. |
| 202 EXPECT_EQ(0, provider.enable_level()); | 206 EXPECT_EQ(0, provider.enable_level()); |
| 203 EXPECT_EQ(0, provider.enable_flags()); | 207 EXPECT_EQ(0, provider.enable_flags()); |
| 204 } | 208 } |
| OLD | NEW |