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

Side by Side Diff: chrome/browser/metrics/thread_watcher_unittest.cc

Issue 2362493002: Stack sampling profiler: set process and thread information (Closed)
Patch Set: address comments Created 4 years, 3 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 | « chrome/browser/metrics/thread_watcher.cc ('k') | chrome/gpu/chrome_content_gpu_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/metrics/thread_watcher.h" 5 #include "chrome/browser/metrics/thread_watcher.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
744 base::RunLoop().Run(); 744 base::RunLoop().Run();
745 745
746 CheckState(false /* has_thread_watcher_list */, 746 CheckState(false /* has_thread_watcher_list */,
747 true /* stopped */, 747 true /* stopped */,
748 "Stopped"); 748 "Stopped");
749 } 749 }
750 750
751 class TestingJankTimeBomb : public JankTimeBomb { 751 class TestingJankTimeBomb : public JankTimeBomb {
752 public: 752 public:
753 explicit TestingJankTimeBomb(base::TimeDelta duration) 753 explicit TestingJankTimeBomb(base::TimeDelta duration)
754 : JankTimeBomb(duration), 754 : JankTimeBomb(duration, metrics::CallStackProfileParams::UI_THREAD),
755 thread_id_(base::PlatformThread::CurrentId()), 755 thread_id_(base::PlatformThread::CurrentId()),
756 alarm_invoked_(false) { 756 alarm_invoked_(false) {
757 } 757 }
758 758
759 ~TestingJankTimeBomb() override {} 759 ~TestingJankTimeBomb() override {}
760 760
761 void Alarm(base::PlatformThreadId thread_id) override { 761 void Alarm(base::PlatformThreadId thread_id) override {
762 EXPECT_EQ(thread_id_, thread_id); 762 EXPECT_EQ(thread_id_, thread_id);
763 alarm_invoked_ = true; 763 alarm_invoked_ = true;
764 } 764 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
824 } 824 }
825 825
826 TEST_F(JankTimeBombTest, ArmTest) { 826 TEST_F(JankTimeBombTest, ArmTest) {
827 // Test firing of Alarm by passing empty delay. 827 // Test firing of Alarm by passing empty delay.
828 TestingJankTimeBomb timebomb((base::TimeDelta())); 828 TestingJankTimeBomb timebomb((base::TimeDelta()));
829 if (!timebomb.IsEnabled()) 829 if (!timebomb.IsEnabled())
830 return; 830 return;
831 WaitForWatchDogThreadPostTask(); 831 WaitForWatchDogThreadPostTask();
832 EXPECT_TRUE(timebomb.alarm_invoked()); 832 EXPECT_TRUE(timebomb.alarm_invoked());
833 } 833 }
OLDNEW
« no previous file with comments | « chrome/browser/metrics/thread_watcher.cc ('k') | chrome/gpu/chrome_content_gpu_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698