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

Side by Side Diff: components/scheduler/renderer/renderer_scheduler_impl_unittest.cc

Issue 2023033003: scheduler: Throttle timers in out-of-view frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add cross origin check, tests Created 4 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/scheduler/renderer/renderer_scheduler_impl.h" 5 #include "components/scheduler/renderer/renderer_scheduler_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 2805 matching lines...) Expand 10 before | Expand all | Expand 10 after
2816 EXPECT_EQ(UseCase::SYNCHRONIZED_GESTURE, CurrentUseCase()); 2816 EXPECT_EQ(UseCase::SYNCHRONIZED_GESTURE, CurrentUseCase());
2817 2817
2818 // 16ms frame - 5ms compositor work = 11ms for other stuff. 2818 // 16ms frame - 5ms compositor work = 11ms for other stuff.
2819 EXPECT_EQ(base::TimeDelta::FromMilliseconds(11), 2819 EXPECT_EQ(base::TimeDelta::FromMilliseconds(11),
2820 scheduler_->EstimateLongestJankFreeTaskDuration()); 2820 scheduler_->EstimateLongestJankFreeTaskDuration());
2821 } 2821 }
2822 2822
2823 class WebViewSchedulerImplForTest : public WebViewSchedulerImpl { 2823 class WebViewSchedulerImplForTest : public WebViewSchedulerImpl {
2824 public: 2824 public:
2825 WebViewSchedulerImplForTest(RendererSchedulerImpl* scheduler) 2825 WebViewSchedulerImplForTest(RendererSchedulerImpl* scheduler)
2826 : WebViewSchedulerImpl(nullptr, scheduler, false) {} 2826 : WebViewSchedulerImpl(nullptr, scheduler, false, true) {}
2827 ~WebViewSchedulerImplForTest() override {} 2827 ~WebViewSchedulerImplForTest() override {}
2828 2828
2829 void AddConsoleWarning(const std::string& message) override { 2829 void AddConsoleWarning(const std::string& message) override {
2830 console_warnings_.push_back(message); 2830 console_warnings_.push_back(message);
2831 } 2831 }
2832 2832
2833 const std::vector<std::string>& console_warnings() const { 2833 const std::vector<std::string>& console_warnings() const {
2834 return console_warnings_; 2834 return console_warnings_;
2835 } 2835 }
2836 2836
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after
3293 base::Unretained(this))); 3293 base::Unretained(this)));
3294 EXPECT_EQ(UseCase::MAIN_THREAD_GESTURE, CurrentUseCase()) << "i = " << i; 3294 EXPECT_EQ(UseCase::MAIN_THREAD_GESTURE, CurrentUseCase()) << "i = " << i;
3295 } 3295 }
3296 3296
3297 EXPECT_EQ(TaskQueue::HIGH_PRIORITY, 3297 EXPECT_EQ(TaskQueue::HIGH_PRIORITY,
3298 scheduler_->CompositorTaskRunner()->GetQueuePriority()); 3298 scheduler_->CompositorTaskRunner()->GetQueuePriority());
3299 EXPECT_EQ(279u, run_order.size()); 3299 EXPECT_EQ(279u, run_order.size());
3300 } 3300 }
3301 3301
3302 } // namespace scheduler 3302 } // namespace scheduler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698