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

Side by Side Diff: components/metrics/public/cpp/call_stack_profile_struct_traits_unittest.cc

Issue 2444143002: Add process lifetime annotations to stack samples. (Closed)
Patch Set: abandon generator for on-the-fly Profiles creation Created 4 years 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include <utility> 5 #include <utility>
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "components/metrics/public/interfaces/call_stack_profile_collector_test .mojom.h" 10 #include "components/metrics/public/interfaces/call_stack_profile_collector_test .mojom.h"
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 base::TimeDelta::FromSeconds(2)), 217 base::TimeDelta::FromSeconds(2)),
218 true 218 true
219 }, 219 },
220 // Valid values for modules and samples. 220 // Valid values for modules and samples.
221 { 221 {
222 CreateProfile({ 222 CreateProfile({
223 Module(0x4000, "a", base::FilePath()), 223 Module(0x4000, "a", base::FilePath()),
224 Module(0x4100, "b", base::FilePath()), 224 Module(0x4100, "b", base::FilePath()),
225 }, 225 },
226 { 226 {
227 { 227 Sample({
228 Frame(0x4010, 0), 228 Frame(0x4010, 0),
229 Frame(0x4110, 1), 229 Frame(0x4110, 1),
230 Frame(0x4110, Frame::kUnknownModuleIndex), 230 Frame(0x4110, Frame::kUnknownModuleIndex),
231 } 231 }),
232 }, 232 },
233 base::TimeDelta::FromSeconds(1), 233 base::TimeDelta::FromSeconds(1),
234 base::TimeDelta::FromSeconds(2)), 234 base::TimeDelta::FromSeconds(2)),
235 true 235 true
236 }, 236 },
237 // Valid values for modules, but an out of range module index in the second 237 // Valid values for modules, but an out of range module index in the second
238 // sample. 238 // sample.
239 { 239 {
240 CreateProfile({ 240 CreateProfile({
241 Module(0x4000, "a", base::FilePath()), 241 Module(0x4000, "a", base::FilePath()),
242 Module(0x4100, "b", base::FilePath()), 242 Module(0x4100, "b", base::FilePath()),
243 }, 243 },
244 { 244 {
245 { 245 Sample({
246 Frame(0x4010, 0), 246 Frame(0x4010, 0),
247 Frame(0x4110, 1), 247 Frame(0x4110, 1),
248 Frame(0x4110, Frame::kUnknownModuleIndex), 248 Frame(0x4110, Frame::kUnknownModuleIndex),
249 }, 249 }),
250 { 250 Sample({
251 Frame(0x4010, 0), 251 Frame(0x4010, 0),
252 Frame(0x4110, 2), 252 Frame(0x4110, 2),
253 }, 253 }),
254 }, 254 },
255 base::TimeDelta::FromSeconds(1), 255 base::TimeDelta::FromSeconds(1),
256 base::TimeDelta::FromSeconds(2)), 256 base::TimeDelta::FromSeconds(2)),
257 false 257 false
258 }, 258 },
259 }; 259 };
260 260
261 for (const SerializeCase& input : serialize_cases) { 261 for (const SerializeCase& input : serialize_cases) {
262 SCOPED_TRACE(&input - &serialize_cases[0]); 262 SCOPED_TRACE(&input - &serialize_cases[0]);
263 263
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 CallStackProfileParams::PRESERVE_ORDER), 393 CallStackProfileParams::PRESERVE_ORDER),
394 &out)); 394 &out));
395 395
396 EXPECT_EQ(CallStackProfileParams::BROWSER_PROCESS, out.process); 396 EXPECT_EQ(CallStackProfileParams::BROWSER_PROCESS, out.process);
397 EXPECT_EQ(CallStackProfileParams::UI_THREAD, out.thread); 397 EXPECT_EQ(CallStackProfileParams::UI_THREAD, out.thread);
398 EXPECT_EQ(CallStackProfileParams::PROCESS_STARTUP, out.trigger); 398 EXPECT_EQ(CallStackProfileParams::PROCESS_STARTUP, out.trigger);
399 EXPECT_EQ(CallStackProfileParams::PRESERVE_ORDER, out.ordering_spec); 399 EXPECT_EQ(CallStackProfileParams::PRESERVE_ORDER, out.ordering_spec);
400 } 400 }
401 401
402 } // namespace metrics 402 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698