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

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: Created 4 years, 1 month 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 {
228 Frame(0x4010, 0), 228 {
229 Frame(0x4110, 1), 229 Frame(0x4010, 0),
230 Frame(0x4110, Frame::kUnknownModuleIndex), 230 Frame(0x4110, 1),
231 Frame(0x4110, Frame::kUnknownModuleIndex),
232 }, 0, 0
231 } 233 }
232 }, 234 },
233 base::TimeDelta::FromSeconds(1), 235 base::TimeDelta::FromSeconds(1),
234 base::TimeDelta::FromSeconds(2)), 236 base::TimeDelta::FromSeconds(2)),
235 true 237 true
236 }, 238 },
237 // Valid values for modules, but an out of range module index in the second 239 // Valid values for modules, but an out of range module index in the second
238 // sample. 240 // sample.
239 { 241 {
240 CreateProfile({ 242 CreateProfile({
241 Module(0x4000, "a", base::FilePath()), 243 Module(0x4000, "a", base::FilePath()),
242 Module(0x4100, "b", base::FilePath()), 244 Module(0x4100, "b", base::FilePath()),
243 }, 245 },
244 { 246 {
245 { 247 {
246 Frame(0x4010, 0), 248 {
247 Frame(0x4110, 1), 249 Frame(0x4010, 0),
248 Frame(0x4110, Frame::kUnknownModuleIndex), 250 Frame(0x4110, 1),
251 Frame(0x4110, Frame::kUnknownModuleIndex),
252 }, 0, 0,
249 }, 253 },
250 { 254 {
251 Frame(0x4010, 0), 255 {
252 Frame(0x4110, 2), 256 Frame(0x4010, 0),
257 Frame(0x4110, 2),
258 },
253 }, 259 },
254 }, 260 },
255 base::TimeDelta::FromSeconds(1), 261 base::TimeDelta::FromSeconds(1),
256 base::TimeDelta::FromSeconds(2)), 262 base::TimeDelta::FromSeconds(2)),
257 false 263 false
258 }, 264 },
259 }; 265 };
260 266
261 for (const SerializeCase& input : serialize_cases) { 267 for (const SerializeCase& input : serialize_cases) {
262 SCOPED_TRACE(&input - &serialize_cases[0]); 268 SCOPED_TRACE(&input - &serialize_cases[0]);
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 CallStackProfileParams::PRESERVE_ORDER), 399 CallStackProfileParams::PRESERVE_ORDER),
394 &out)); 400 &out));
395 401
396 EXPECT_EQ(CallStackProfileParams::BROWSER_PROCESS, out.process); 402 EXPECT_EQ(CallStackProfileParams::BROWSER_PROCESS, out.process);
397 EXPECT_EQ(CallStackProfileParams::UI_THREAD, out.thread); 403 EXPECT_EQ(CallStackProfileParams::UI_THREAD, out.thread);
398 EXPECT_EQ(CallStackProfileParams::PROCESS_STARTUP, out.trigger); 404 EXPECT_EQ(CallStackProfileParams::PROCESS_STARTUP, out.trigger);
399 EXPECT_EQ(CallStackProfileParams::PRESERVE_ORDER, out.ordering_spec); 405 EXPECT_EQ(CallStackProfileParams::PRESERVE_ORDER, out.ordering_spec);
400 } 406 }
401 407
402 } // namespace metrics 408 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698