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

Side by Side Diff: base/trace_event/memory_dump_manager_unittest.cc

Issue 2737153002: [memory-infra] Implement peak detection logic (Closed)
Patch Set: nit. Created 3 years, 9 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/trace_event/memory_dump_manager.h" 5 #include "base/trace_event/memory_dump_manager.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
763 763
764 MemoryDumpProvider::Options options; 764 MemoryDumpProvider::Options options;
765 options.is_fast_polling_supported = true; 765 options.is_fast_polling_supported = true;
766 RegisterDumpProvider(mdp1.get(), nullptr, options); 766 RegisterDumpProvider(mdp1.get(), nullptr, options);
767 767
768 RunLoop run_loop; 768 RunLoop run_loop;
769 scoped_refptr<SingleThreadTaskRunner> test_task_runner = 769 scoped_refptr<SingleThreadTaskRunner> test_task_runner =
770 ThreadTaskRunnerHandle::Get(); 770 ThreadTaskRunnerHandle::Get();
771 auto quit_closure = run_loop.QuitClosure(); 771 auto quit_closure = run_loop.QuitClosure();
772 772
773 const int kPollsToQuit = 10; 773 const int kPollsToQuit = 60;
Primiano Tucci (use gerrit) 2017/03/10 10:19:32 out of curiosity, why? isn't this going to make th
ssid 2017/03/10 19:49:01 Thought more about it and it does not help the tes
774 int call_count = 0; 774 int call_count = 0;
775 MemoryDumpManager* mdm = mdm_.get(); 775 MemoryDumpManager* mdm = mdm_.get();
776 const auto poll_function1 = [&call_count, &test_task_runner, quit_closure, 776 const auto poll_function1 = [&call_count, &test_task_runner, quit_closure,
777 &mdp2, mdm, &options, kPollsToQuit, 777 &mdp2, mdm, &options, kPollsToQuit,
778 this](uint64_t* total) -> void { 778 this](uint64_t* total) -> void {
779 ++call_count; 779 ++call_count;
780 if (call_count == 1) 780 if (call_count == 1)
781 RegisterDumpProvider(mdp2.get(), nullptr, options, kMDPName); 781 RegisterDumpProvider(mdp2.get(), nullptr, options, kMDPName);
782 else if (call_count == 4) 782 else if (call_count == 4)
783 mdm->UnregisterAndDeleteDumpProviderSoon(std::move(mdp2)); 783 mdm->UnregisterAndDeleteDumpProviderSoon(std::move(mdp2));
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
1286 thread.Start(); 1286 thread.Start();
1287 RegisterDumpProvider(&mdp1, thread.task_runner(), kDefaultOptions, 1287 RegisterDumpProvider(&mdp1, thread.task_runner(), kDefaultOptions,
1288 "BlacklistTestDumpProvider"); 1288 "BlacklistTestDumpProvider");
1289 // Unregistering on wrong thread should not crash. 1289 // Unregistering on wrong thread should not crash.
1290 mdm_->UnregisterDumpProvider(&mdp1); 1290 mdm_->UnregisterDumpProvider(&mdp1);
1291 thread.Stop(); 1291 thread.Stop();
1292 } 1292 }
1293 1293
1294 } // namespace trace_event 1294 } // namespace trace_event
1295 } // namespace base 1295 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/trace_event/memory_dump_scheduler.h » ('j') | base/trace_event/memory_dump_scheduler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698