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

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

Issue 18584011: Rename base::Delete to base::DeleteFile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « base/win/event_trace_consumer_unittest.cc ('k') | chrome/browser/android/crash_dump_manager.cc » ('j') | 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 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/file_util.h" 10 #include "base/file_util.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 ScopedTempDir temp_dir; 164 ScopedTempDir temp_dir;
165 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 165 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
166 FilePath temp; 166 FilePath temp;
167 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), &temp)); 167 ASSERT_TRUE(file_util::CreateTemporaryFileInDir(temp_dir.path(), &temp));
168 168
169 EtwTraceController controller; 169 EtwTraceController controller;
170 HRESULT hr = controller.StartFileSession(session_name_.c_str(), 170 HRESULT hr = controller.StartFileSession(session_name_.c_str(),
171 temp.value().c_str()); 171 temp.value().c_str());
172 if (hr == E_ACCESSDENIED) { 172 if (hr == E_ACCESSDENIED) {
173 VLOG(1) << "You must be an administrator to run this test on Vista"; 173 VLOG(1) << "You must be an administrator to run this test on Vista";
174 base::Delete(temp, false); 174 base::DeleteFile(temp, false);
175 return; 175 return;
176 } 176 }
177 177
178 EXPECT_TRUE(NULL != controller.session()); 178 EXPECT_TRUE(NULL != controller.session());
179 EXPECT_STREQ(session_name_.c_str(), controller.session_name()); 179 EXPECT_STREQ(session_name_.c_str(), controller.session_name());
180 180
181 EXPECT_HRESULT_SUCCEEDED(controller.Stop(NULL)); 181 EXPECT_HRESULT_SUCCEEDED(controller.Stop(NULL));
182 EXPECT_EQ(NULL, controller.session()); 182 EXPECT_EQ(NULL, controller.session());
183 EXPECT_STREQ(L"", controller.session_name()); 183 EXPECT_STREQ(L"", controller.session_name());
184 base::Delete(temp, false); 184 base::DeleteFile(temp, false);
185 } 185 }
186 186
187 TEST_F(EtwTraceControllerTest, EnableDisable) { 187 TEST_F(EtwTraceControllerTest, EnableDisable) {
188 TestingProvider provider(test_provider_); 188 TestingProvider provider(test_provider_);
189 189
190 EXPECT_EQ(ERROR_SUCCESS, provider.Register()); 190 EXPECT_EQ(ERROR_SUCCESS, provider.Register());
191 EXPECT_EQ(NULL, provider.session_handle()); 191 EXPECT_EQ(NULL, provider.session_handle());
192 192
193 EtwTraceController controller; 193 EtwTraceController controller;
194 HRESULT hr = controller.StartRealtimeSession(session_name_.c_str(), 194 HRESULT hr = controller.StartRealtimeSession(session_name_.c_str(),
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 provider.WaitForCallback(); 231 provider.WaitForCallback();
232 232
233 // Session should have wound down. 233 // Session should have wound down.
234 EXPECT_EQ(0, provider.enable_level()); 234 EXPECT_EQ(0, provider.enable_level());
235 EXPECT_EQ(0, provider.enable_flags()); 235 EXPECT_EQ(0, provider.enable_flags());
236 } 236 }
237 237
238 } // namespace win 238 } // namespace win
239 } // namespace base 239 } // namespace base
OLDNEW
« no previous file with comments | « base/win/event_trace_consumer_unittest.cc ('k') | chrome/browser/android/crash_dump_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698