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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « components/scheduler/renderer/throttling_helper.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "components/scheduler/renderer/throttling_helper.h" 5 #include "components/scheduler/renderer/throttling_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 10
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 throttling_helper_->IncreaseThrottleRefCount(timer_queue_.get()); 421 throttling_helper_->IncreaseThrottleRefCount(timer_queue_.get());
422 EXPECT_FALSE(timer_queue_->IsQueueEnabled()); 422 EXPECT_FALSE(timer_queue_->IsQueueEnabled());
423 423
424 mock_task_runner_->RunUntilIdle(); // Wait until the pump. 424 mock_task_runner_->RunUntilIdle(); // Wait until the pump.
425 EXPECT_TRUE(timer_queue_->IsQueueEnabled()); 425 EXPECT_TRUE(timer_queue_->IsQueueEnabled());
426 426
427 throttling_helper_->SetQueueEnabled(timer_queue_.get(), false); 427 throttling_helper_->SetQueueEnabled(timer_queue_.get(), false);
428 EXPECT_FALSE(timer_queue_->IsQueueEnabled()); 428 EXPECT_FALSE(timer_queue_->IsQueueEnabled());
429 } 429 }
430 430
431 TEST_F(ThrottlingHelperTest, DoubleIncrementDoubleDecrement) {
432 timer_queue_->PostTask(FROM_HERE, base::Bind(&NopTask));
433
434 EXPECT_TRUE(timer_queue_->IsQueueEnabled());
435 throttling_helper_->IncreaseThrottleRefCount(timer_queue_.get());
436 throttling_helper_->IncreaseThrottleRefCount(timer_queue_.get());
437 EXPECT_FALSE(timer_queue_->IsQueueEnabled());
438 throttling_helper_->DecreaseThrottleRefCount(timer_queue_.get());
439 throttling_helper_->DecreaseThrottleRefCount(timer_queue_.get());
440 EXPECT_TRUE(timer_queue_->IsQueueEnabled());
441 }
442
431 } // namespace scheduler 443 } // namespace scheduler
OLDNEW
« 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