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

Side by Side Diff: trunk/src/base/threading/sequenced_worker_pool_unittest.cc

Issue 18861008: Revert 210434 "Revert 210433 "Revert 210423 "base: Make Sequence..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « trunk/src/base/threading/sequenced_worker_pool.cc ('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 (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 "base/threading/sequenced_worker_pool.h" 5 #include "base/threading/sequenced_worker_pool.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 } 721 }
722 722
723 // Verify correctness of the IsRunningSequenceOnCurrentThread method. 723 // Verify correctness of the IsRunningSequenceOnCurrentThread method.
724 TEST_F(SequencedWorkerPoolTest, IsRunningOnCurrentThread) { 724 TEST_F(SequencedWorkerPoolTest, IsRunningOnCurrentThread) {
725 SequencedWorkerPool::SequenceToken token1 = pool()->GetSequenceToken(); 725 SequencedWorkerPool::SequenceToken token1 = pool()->GetSequenceToken();
726 SequencedWorkerPool::SequenceToken token2 = pool()->GetSequenceToken(); 726 SequencedWorkerPool::SequenceToken token2 = pool()->GetSequenceToken();
727 SequencedWorkerPool::SequenceToken unsequenced_token; 727 SequencedWorkerPool::SequenceToken unsequenced_token;
728 728
729 scoped_refptr<SequencedWorkerPool> unused_pool = 729 scoped_refptr<SequencedWorkerPool> unused_pool =
730 new SequencedWorkerPool(2, "unused_pool"); 730 new SequencedWorkerPool(2, "unused_pool");
731 EXPECT_TRUE(token1.Equals(unused_pool->GetSequenceToken()));
732 EXPECT_TRUE(token2.Equals(unused_pool->GetSequenceToken()));
731 733
732 EXPECT_FALSE(pool()->RunsTasksOnCurrentThread()); 734 EXPECT_FALSE(pool()->RunsTasksOnCurrentThread());
733 EXPECT_FALSE(pool()->IsRunningSequenceOnCurrentThread(token1)); 735 EXPECT_FALSE(pool()->IsRunningSequenceOnCurrentThread(token1));
734 EXPECT_FALSE(pool()->IsRunningSequenceOnCurrentThread(token2)); 736 EXPECT_FALSE(pool()->IsRunningSequenceOnCurrentThread(token2));
735 EXPECT_FALSE(pool()->IsRunningSequenceOnCurrentThread(unsequenced_token)); 737 EXPECT_FALSE(pool()->IsRunningSequenceOnCurrentThread(unsequenced_token));
736 EXPECT_FALSE(unused_pool->RunsTasksOnCurrentThread()); 738 EXPECT_FALSE(unused_pool->RunsTasksOnCurrentThread());
737 EXPECT_FALSE(unused_pool->IsRunningSequenceOnCurrentThread(token1)); 739 EXPECT_FALSE(unused_pool->IsRunningSequenceOnCurrentThread(token1));
738 EXPECT_FALSE(unused_pool->IsRunningSequenceOnCurrentThread(token2)); 740 EXPECT_FALSE(unused_pool->IsRunningSequenceOnCurrentThread(token2));
739 EXPECT_FALSE( 741 EXPECT_FALSE(
740 unused_pool->IsRunningSequenceOnCurrentThread(unsequenced_token)); 742 unused_pool->IsRunningSequenceOnCurrentThread(unsequenced_token));
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 SequencedWorkerPoolSequencedTaskRunner, TaskRunnerTest, 929 SequencedWorkerPoolSequencedTaskRunner, TaskRunnerTest,
928 SequencedWorkerPoolSequencedTaskRunnerTestDelegate); 930 SequencedWorkerPoolSequencedTaskRunnerTestDelegate);
929 931
930 INSTANTIATE_TYPED_TEST_CASE_P( 932 INSTANTIATE_TYPED_TEST_CASE_P(
931 SequencedWorkerPoolSequencedTaskRunner, SequencedTaskRunnerTest, 933 SequencedWorkerPoolSequencedTaskRunner, SequencedTaskRunnerTest,
932 SequencedWorkerPoolSequencedTaskRunnerTestDelegate); 934 SequencedWorkerPoolSequencedTaskRunnerTestDelegate);
933 935
934 } // namespace 936 } // namespace
935 937
936 } // namespace base 938 } // namespace base
OLDNEW
« no previous file with comments | « trunk/src/base/threading/sequenced_worker_pool.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698