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

Side by Side Diff: chrome/browser/sync/glue/sync_backend_registrar_unittest.cc

Issue 666733003: Standardize usage of virtual/override/final in chrome/browser/sync/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 "chrome/browser/sync/glue/sync_backend_registrar.h" 5 #include "chrome/browser/sync/glue/sync_backend_registrar.h"
6 6
7 #include "chrome/browser/sync/glue/ui_model_worker.h" 7 #include "chrome/browser/sync/glue/ui_model_worker.h"
8 #include "chrome/test/base/testing_profile.h" 8 #include "chrome/test/base/testing_profile.h"
9 #include "components/sync_driver/change_processor_mock.h" 9 #include "components/sync_driver/change_processor_mock.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 }; 284 };
285 285
286 // Wrap SyncBackendRegistrar so that we can monitor its lifetime. 286 // Wrap SyncBackendRegistrar so that we can monitor its lifetime.
287 class TestRegistrar : public SyncBackendRegistrar { 287 class TestRegistrar : public SyncBackendRegistrar {
288 public: 288 public:
289 explicit TestRegistrar(Profile* profile, 289 explicit TestRegistrar(Profile* profile,
290 SyncBackendRegistrarShutdownTest* test) 290 SyncBackendRegistrarShutdownTest* test)
291 : SyncBackendRegistrar("test", profile, scoped_ptr<base::Thread>()), 291 : SyncBackendRegistrar("test", profile, scoped_ptr<base::Thread>()),
292 test_(test) {} 292 test_(test) {}
293 293
294 virtual ~TestRegistrar() { test_->registrar_destroyed_.Signal(); } 294 ~TestRegistrar() override { test_->registrar_destroyed_.Signal(); }
295 295
296 private: 296 private:
297 SyncBackendRegistrarShutdownTest* test_; 297 SyncBackendRegistrarShutdownTest* test_;
298 }; 298 };
299 299
300 TEST_F(SyncBackendRegistrarShutdownTest, BlockingShutdown) { 300 TEST_F(SyncBackendRegistrarShutdownTest, BlockingShutdown) {
301 // Take ownership of |db_thread_lock_| so that the DB thread can't acquire it. 301 // Take ownership of |db_thread_lock_| so that the DB thread can't acquire it.
302 db_thread_lock_.Acquire(); 302 db_thread_lock_.Acquire();
303 303
304 // This will block the DB thread by waiting on |db_thread_lock_|. 304 // This will block the DB thread by waiting on |db_thread_lock_|.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 base::MessageLoop::current()->RunUntilIdle(); 337 base::MessageLoop::current()->RunUntilIdle();
338 338
339 // This verifies that all workers have been removed and the registrar 339 // This verifies that all workers have been removed and the registrar
340 // destroyed. 340 // destroyed.
341 registrar_destroyed_.Wait(); 341 registrar_destroyed_.Wait();
342 } 342 }
343 343
344 } // namespace 344 } // namespace
345 345
346 } // namespace browser_sync 346 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/sync_backend_registrar.h ('k') | chrome/browser/sync/glue/theme_data_type_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698