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

Unified Diff: components/scheduler/renderer/throttling_helper_unittest.cc

Issue 2081663002: Add a few extra tests for throttling corner cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/scheduler/renderer/throttling_helper.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/scheduler/renderer/throttling_helper_unittest.cc
diff --git a/components/scheduler/renderer/throttling_helper_unittest.cc b/components/scheduler/renderer/throttling_helper_unittest.cc
index 360c13d25da264cbe39c57cef7a9cece72ba2324..117e9a2baa0489dc506b2c563b69207870db5c20 100644
--- a/components/scheduler/renderer/throttling_helper_unittest.cc
+++ b/components/scheduler/renderer/throttling_helper_unittest.cc
@@ -428,4 +428,16 @@ TEST_F(ThrottlingHelperTest, TaskQueueDisabledTillPump_ThenManuallyDisabled) {
EXPECT_FALSE(timer_queue_->IsQueueEnabled());
}
+TEST_F(ThrottlingHelperTest, DoubleIncrementDoubleDecrement) {
+ timer_queue_->PostTask(FROM_HERE, base::Bind(&NopTask));
+
+ EXPECT_TRUE(timer_queue_->IsQueueEnabled());
+ throttling_helper_->IncreaseThrottleRefCount(timer_queue_.get());
+ throttling_helper_->IncreaseThrottleRefCount(timer_queue_.get());
+ EXPECT_FALSE(timer_queue_->IsQueueEnabled());
+ throttling_helper_->DecreaseThrottleRefCount(timer_queue_.get());
+ throttling_helper_->DecreaseThrottleRefCount(timer_queue_.get());
+ EXPECT_TRUE(timer_queue_->IsQueueEnabled());
+}
+
} // namespace scheduler
« no previous file with comments | « components/scheduler/renderer/throttling_helper.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698