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

Side by Side Diff: base/debug/activity_analyzer_unittest.cc

Issue 2666653002: Record field-trial information in stability file for crash analysis. (Closed)
Patch Set: addressed review comments by asvitkine Created 3 years, 10 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 | « no previous file | base/debug/activity_tracker.h » ('j') | base/debug/activity_tracker.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/debug/activity_analyzer.h" 5 #include "base/debug/activity_analyzer.h"
6 6
7 #include <atomic> 7 #include <atomic>
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 GlobalActivityTracker::CreateWithLocalMemory(kMemorySize, 0, "", 3); 282 GlobalActivityTracker::CreateWithLocalMemory(kMemorySize, 0, "", 3);
283 283
284 const char string1[] = "foo"; 284 const char string1[] = "foo";
285 const char string2[] = "bar"; 285 const char string2[] = "bar";
286 286
287 PersistentMemoryAllocator* allocator = 287 PersistentMemoryAllocator* allocator =
288 GlobalActivityTracker::Get()->allocator(); 288 GlobalActivityTracker::Get()->allocator();
289 GlobalActivityAnalyzer global_analyzer(MakeUnique<PersistentMemoryAllocator>( 289 GlobalActivityAnalyzer global_analyzer(MakeUnique<PersistentMemoryAllocator>(
290 const_cast<void*>(allocator->data()), allocator->size(), 0, 0, "", true)); 290 const_cast<void*>(allocator->data()), allocator->size(), 0, 0, "", true));
291 291
292 ActivityUserData& global_data = GlobalActivityTracker::Get()->user_data(); 292 ActivityUserData& global_data = GlobalActivityTracker::Get()->global_data();
293 global_data.Set("raw", "foo", 3); 293 global_data.Set("raw", "foo", 3);
294 global_data.SetString("string", "bar"); 294 global_data.SetString("string", "bar");
295 global_data.SetChar("char", '9'); 295 global_data.SetChar("char", '9');
296 global_data.SetInt("int", -9999); 296 global_data.SetInt("int", -9999);
297 global_data.SetUint("uint", 9999); 297 global_data.SetUint("uint", 9999);
298 global_data.SetBool("bool", true); 298 global_data.SetBool("bool", true);
299 global_data.SetReference("ref", string1, sizeof(string1)); 299 global_data.SetReference("ref", string1, sizeof(string1));
300 global_data.SetStringReference("sref", string2); 300 global_data.SetStringReference("sref", string2);
301 301
302 ActivityUserData::Snapshot snapshot = 302 ActivityUserData::Snapshot snapshot =
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 GlobalActivityTracker::Get()->RecordLogMessage("foo bar"); 409 GlobalActivityTracker::Get()->RecordLogMessage("foo bar");
410 410
411 std::vector<std::string> messages = analyzer.GetLogMessages(); 411 std::vector<std::string> messages = analyzer.GetLogMessages();
412 ASSERT_EQ(2U, messages.size()); 412 ASSERT_EQ(2U, messages.size());
413 EXPECT_EQ("hello world", messages[0]); 413 EXPECT_EQ("hello world", messages[0]);
414 EXPECT_EQ("foo bar", messages[1]); 414 EXPECT_EQ("foo bar", messages[1]);
415 } 415 }
416 416
417 } // namespace debug 417 } // namespace debug
418 } // namespace base 418 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/debug/activity_tracker.h » ('j') | base/debug/activity_tracker.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698