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

Side by Side Diff: test/unittests/libplatform/task-queue-unittest.cc

Issue 1412223018: [presubmit] Enabling readability/inheritance linter checking. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressing comments Created 5 years, 1 month 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 | « test/unittests/base/platform/semaphore-unittest.cc ('k') | test/unittests/run-all-unittests.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project 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 "include/v8-platform.h" 5 #include "include/v8-platform.h"
6 #include "src/base/platform/platform.h" 6 #include "src/base/platform/platform.h"
7 #include "src/libplatform/task-queue.h" 7 #include "src/libplatform/task-queue.h"
8 #include "testing/gmock/include/gmock/gmock.h" 8 #include "testing/gmock/include/gmock/gmock.h"
9 9
10 using testing::InSequence; 10 using testing::InSequence;
11 using testing::IsNull; 11 using testing::IsNull;
12 using testing::StrictMock; 12 using testing::StrictMock;
13 13
14 namespace v8 { 14 namespace v8 {
15 namespace platform { 15 namespace platform {
16 16
17 namespace { 17 namespace {
18 18
19 struct MockTask : public Task { 19 struct MockTask : public Task {
20 MOCK_METHOD0(Run, void()); 20 MOCK_METHOD0(Run, void());
21 }; 21 };
22 22
23 23
24 class TaskQueueThread final : public base::Thread { 24 class TaskQueueThread final : public base::Thread {
25 public: 25 public:
26 explicit TaskQueueThread(TaskQueue* queue) 26 explicit TaskQueueThread(TaskQueue* queue)
27 : Thread(Options("libplatform TaskQueueThread")), queue_(queue) {} 27 : Thread(Options("libplatform TaskQueueThread")), queue_(queue) {}
28 28
29 virtual void Run() override { EXPECT_THAT(queue_->GetNext(), IsNull()); } 29 void Run() override { EXPECT_THAT(queue_->GetNext(), IsNull()); }
30 30
31 private: 31 private:
32 TaskQueue* queue_; 32 TaskQueue* queue_;
33 }; 33 };
34 34
35 } // namespace 35 } // namespace
36 36
37 37
38 TEST(TaskQueueTest, Basic) { 38 TEST(TaskQueueTest, Basic) {
39 TaskQueue queue; 39 TaskQueue queue;
(...skipping 11 matching lines...) Expand all
51 TaskQueueThread thread2(&queue); 51 TaskQueueThread thread2(&queue);
52 thread1.Start(); 52 thread1.Start();
53 thread2.Start(); 53 thread2.Start();
54 queue.Terminate(); 54 queue.Terminate();
55 thread1.Join(); 55 thread1.Join();
56 thread2.Join(); 56 thread2.Join();
57 } 57 }
58 58
59 } // namespace platform 59 } // namespace platform
60 } // namespace v8 60 } // namespace v8
OLDNEW
« no previous file with comments | « test/unittests/base/platform/semaphore-unittest.cc ('k') | test/unittests/run-all-unittests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698