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

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

Issue 2275553005: //base: Make ScopedTempDir::path() a GetPath() with a DCHECK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments Created 4 years, 3 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
« no previous file with comments | « base/win/event_trace_consumer_unittest.cc ('k') | base/win/shortcut_unittest.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/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 154
155 EXPECT_HRESULT_SUCCEEDED(controller.Stop(NULL)); 155 EXPECT_HRESULT_SUCCEEDED(controller.Stop(NULL));
156 EXPECT_EQ(0u, controller.session()); 156 EXPECT_EQ(0u, controller.session());
157 EXPECT_STREQ(L"", controller.session_name()); 157 EXPECT_STREQ(L"", controller.session_name());
158 } 158 }
159 159
160 TEST_F(EtwTraceControllerTest, StartFileSession) { 160 TEST_F(EtwTraceControllerTest, StartFileSession) {
161 ScopedTempDir temp_dir; 161 ScopedTempDir temp_dir;
162 ASSERT_TRUE(temp_dir.CreateUniqueTempDir()); 162 ASSERT_TRUE(temp_dir.CreateUniqueTempDir());
163 FilePath temp; 163 FilePath temp;
164 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.path(), &temp)); 164 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir.GetPath(), &temp));
165 165
166 EtwTraceController controller; 166 EtwTraceController controller;
167 HRESULT hr = controller.StartFileSession(session_name_.c_str(), 167 HRESULT hr = controller.StartFileSession(session_name_.c_str(),
168 temp.value().c_str()); 168 temp.value().c_str());
169 if (hr == E_ACCESSDENIED) { 169 if (hr == E_ACCESSDENIED) {
170 VLOG(1) << "You must be an administrator to run this test on Vista"; 170 VLOG(1) << "You must be an administrator to run this test on Vista";
171 base::DeleteFile(temp, false); 171 base::DeleteFile(temp, false);
172 return; 172 return;
173 } 173 }
174 174
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 provider.WaitForCallback(); 235 provider.WaitForCallback();
236 236
237 // Session should have wound down. 237 // Session should have wound down.
238 EXPECT_EQ(0, provider.enable_level()); 238 EXPECT_EQ(0, provider.enable_level());
239 EXPECT_EQ(0u, provider.enable_flags()); 239 EXPECT_EQ(0u, provider.enable_flags());
240 } 240 }
241 } 241 }
242 242
243 } // namespace win 243 } // namespace win
244 } // namespace base 244 } // namespace base
OLDNEW
« no previous file with comments | « base/win/event_trace_consumer_unittest.cc ('k') | base/win/shortcut_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698