| OLD | NEW |
| 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 "components/browser_watcher/postmortem_report_collector.h" | 5 #include "components/browser_watcher/postmortem_report_collector.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 560 } | 560 } |
| 561 | 561 |
| 562 TEST_F(PostmortemReportCollectorCollectionFromGlobalTrackerTest, | 562 TEST_F(PostmortemReportCollectorCollectionFromGlobalTrackerTest, |
| 563 GlobalUserDataCollection) { | 563 GlobalUserDataCollection) { |
| 564 const char string1[] = "foo"; | 564 const char string1[] = "foo"; |
| 565 const char string2[] = "bar"; | 565 const char string2[] = "bar"; |
| 566 | 566 |
| 567 // Record some global user data. | 567 // Record some global user data. |
| 568 GlobalActivityTracker::CreateWithFile(debug_file_path(), kMemorySize, 0ULL, | 568 GlobalActivityTracker::CreateWithFile(debug_file_path(), kMemorySize, 0ULL, |
| 569 "", 3); | 569 "", 3); |
| 570 ActivityUserData& global_data = GlobalActivityTracker::Get()->user_data(); | 570 ActivityUserData& global_data = GlobalActivityTracker::Get()->global_data(); |
| 571 global_data.Set("raw", "foo", 3); | 571 global_data.Set("raw", "foo", 3); |
| 572 global_data.SetString("string", "bar"); | 572 global_data.SetString("string", "bar"); |
| 573 global_data.SetChar("char", '9'); | 573 global_data.SetChar("char", '9'); |
| 574 global_data.SetInt("int", -9999); | 574 global_data.SetInt("int", -9999); |
| 575 global_data.SetUint("uint", 9999); | 575 global_data.SetUint("uint", 9999); |
| 576 global_data.SetBool("bool", true); | 576 global_data.SetBool("bool", true); |
| 577 global_data.SetReference("ref", string1, strlen(string1)); | 577 global_data.SetReference("ref", string1, strlen(string1)); |
| 578 global_data.SetStringReference("sref", string2); | 578 global_data.SetStringReference("sref", string2); |
| 579 | 579 |
| 580 // Collect the stability report. | 580 // Collect the stability report. |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 EXPECT_EQ("CAFECAFE2d000", collected_module.code_identifier()); | 670 EXPECT_EQ("CAFECAFE2d000", collected_module.code_identifier()); |
| 671 EXPECT_EQ(module_info.debug_file, collected_module.debug_file()); | 671 EXPECT_EQ(module_info.debug_file, collected_module.debug_file()); |
| 672 EXPECT_EQ("1122334455667788ABCD0123456789AB1", | 672 EXPECT_EQ("1122334455667788ABCD0123456789AB1", |
| 673 collected_module.debug_identifier()); | 673 collected_module.debug_identifier()); |
| 674 EXPECT_EQ("", collected_module.version()); | 674 EXPECT_EQ("", collected_module.version()); |
| 675 EXPECT_EQ(0LL, collected_module.shrink_down_delta()); | 675 EXPECT_EQ(0LL, collected_module.shrink_down_delta()); |
| 676 EXPECT_EQ(!module_info.is_loaded, collected_module.is_unloaded()); | 676 EXPECT_EQ(!module_info.is_loaded, collected_module.is_unloaded()); |
| 677 } | 677 } |
| 678 | 678 |
| 679 } // namespace browser_watcher | 679 } // namespace browser_watcher |
| OLD | NEW |