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

Side by Side Diff: sync/internal_api/public/base/cancelation_signal_unittest.cc

Issue 792343004: Standardize usage of virtual/override/final specifiers in sync/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "sync/internal_api/public/base/cancelation_signal.h" 5 #include "sync/internal_api/public/base/cancelation_signal.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop/message_loop.h" 8 #include "base/message_loop/message_loop.h"
9 #include "base/synchronization/waitable_event.h" 9 #include "base/synchronization/waitable_event.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 event_.Signal(); 86 event_.Signal();
87 } 87 }
88 88
89 bool BlockingTask::WasStarted() { 89 bool BlockingTask::WasStarted() {
90 return was_started_; 90 return was_started_;
91 } 91 }
92 92
93 class CancelationSignalTest : public ::testing::Test { 93 class CancelationSignalTest : public ::testing::Test {
94 public: 94 public:
95 CancelationSignalTest(); 95 CancelationSignalTest();
96 virtual ~CancelationSignalTest(); 96 ~CancelationSignalTest() override;
97 97
98 // Starts the blocking task on a background thread. Does not wait for the 98 // Starts the blocking task on a background thread. Does not wait for the
99 // task to start. 99 // task to start.
100 void StartBlockingTaskAsync(); 100 void StartBlockingTaskAsync();
101 101
102 // Starts the blocking task on a background thread. Does not return until 102 // Starts the blocking task on a background thread. Does not return until
103 // the task has been started. 103 // the task has been started.
104 void StartBlockingTaskAndWaitForItToStart(); 104 void StartBlockingTaskAndWaitForItToStart();
105 105
106 // Cancels the blocking task. 106 // Cancels the blocking task.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 // progress. 177 // progress.
178 TEST_F(CancelationSignalTest, Cancel) { 178 TEST_F(CancelationSignalTest, Cancel) {
179 StartBlockingTaskAndWaitForItToStart(); 179 StartBlockingTaskAndWaitForItToStart();
180 180
181 // Wait for the task to finish and let verify it has been started. 181 // Wait for the task to finish and let verify it has been started.
182 CancelBlocking(); 182 CancelBlocking();
183 EXPECT_FALSE(VerifyTaskNotStarted()); 183 EXPECT_FALSE(VerifyTaskNotStarted());
184 } 184 }
185 185
186 } // namespace syncer 186 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/protocol_event_buffer_unittest.cc ('k') | sync/internal_api/public/util/weak_handle_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698