| 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 controller. | 5 // Unit tests for event trace controller. |
| 6 | 6 |
| 7 #include <objbase.h> | 7 #include <objbase.h> |
| 8 #include <initguid.h> | 8 #include <initguid.h> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 EXPECT_TRUE(NULL != controller.session()); | 173 EXPECT_TRUE(NULL != controller.session()); |
| 174 EXPECT_STREQ(session_name_.c_str(), controller.session_name()); | 174 EXPECT_STREQ(session_name_.c_str(), controller.session_name()); |
| 175 | 175 |
| 176 EXPECT_HRESULT_SUCCEEDED(controller.Stop(NULL)); | 176 EXPECT_HRESULT_SUCCEEDED(controller.Stop(NULL)); |
| 177 EXPECT_EQ(NULL, controller.session()); | 177 EXPECT_EQ(NULL, controller.session()); |
| 178 EXPECT_STREQ(L"", controller.session_name()); | 178 EXPECT_STREQ(L"", controller.session_name()); |
| 179 base::DeleteFile(temp, false); | 179 base::DeleteFile(temp, false); |
| 180 } | 180 } |
| 181 | 181 |
| 182 // Disable until bug 525297 is fixed (hangs on Windows 7?) | 182 // Disable until bug 525297 is fixed (hangs on Windows 7?) |
| 183 TEST_F(EtwTraceControllerTest, DISABLE_EnableDisable) { | 183 TEST_F(EtwTraceControllerTest, DISABLED_EnableDisable) { |
| 184 TestingProvider provider(test_provider_); | 184 TestingProvider provider(test_provider_); |
| 185 | 185 |
| 186 EXPECT_EQ(ERROR_SUCCESS, provider.Register()); | 186 EXPECT_EQ(ERROR_SUCCESS, provider.Register()); |
| 187 EXPECT_EQ(NULL, provider.session_handle()); | 187 EXPECT_EQ(NULL, provider.session_handle()); |
| 188 | 188 |
| 189 EtwTraceController controller; | 189 EtwTraceController controller; |
| 190 HRESULT hr = controller.StartRealtimeSession(session_name_.c_str(), | 190 HRESULT hr = controller.StartRealtimeSession(session_name_.c_str(), |
| 191 100 * 1024); | 191 100 * 1024); |
| 192 if (hr == E_ACCESSDENIED) { | 192 if (hr == E_ACCESSDENIED) { |
| 193 VLOG(1) << "You must be an administrator to run this test on Vista"; | 193 VLOG(1) << "You must be an administrator to run this test on Vista"; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 | 229 |
| 230 provider.WaitForCallback(); | 230 provider.WaitForCallback(); |
| 231 | 231 |
| 232 // Session should have wound down. | 232 // Session should have wound down. |
| 233 EXPECT_EQ(0, provider.enable_level()); | 233 EXPECT_EQ(0, provider.enable_level()); |
| 234 EXPECT_EQ(0, provider.enable_flags()); | 234 EXPECT_EQ(0, provider.enable_flags()); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace win | 237 } // namespace win |
| 238 } // namespace base | 238 } // namespace base |
| OLD | NEW |