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

Side by Side Diff: sync/internal_api/public/util/weak_handle_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 5 years, 12 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 "sync/internal_api/public/util/weak_handle.h" 5 #include "sync/internal_api/public/util/weak_handle.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 29 matching lines...) Expand all
40 MOCK_METHOD1(TestWithSelf, void(const WeakHandle<Base>&)); 40 MOCK_METHOD1(TestWithSelf, void(const WeakHandle<Base>&));
41 41
42 private: 42 private:
43 base::WeakPtrFactory<Base> weak_ptr_factory_; 43 base::WeakPtrFactory<Base> weak_ptr_factory_;
44 }; 44 };
45 45
46 class Derived : public Base, public base::SupportsWeakPtr<Derived> {}; 46 class Derived : public Base, public base::SupportsWeakPtr<Derived> {};
47 47
48 class WeakHandleTest : public ::testing::Test { 48 class WeakHandleTest : public ::testing::Test {
49 protected: 49 protected:
50 virtual void TearDown() { 50 void TearDown() override {
51 // Process any last-minute posted tasks. 51 // Process any last-minute posted tasks.
52 PumpLoop(); 52 PumpLoop();
53 } 53 }
54 54
55 void PumpLoop() { 55 void PumpLoop() {
56 message_loop_.RunUntilIdle(); 56 message_loop_.RunUntilIdle();
57 } 57 }
58 58
59 static void CallTestFromOtherThread(tracked_objects::Location from_here, 59 static void CallTestFromOtherThread(tracked_objects::Location from_here,
60 const WeakHandle<Base>& h) { 60 const WeakHandle<Base>& h) {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 EXPECT_FALSE(base_weak_handle.IsInitialized()); 317 EXPECT_FALSE(base_weak_handle.IsInitialized());
318 } 318 }
319 319
320 TEST_F(WeakHandleTest, TypeConversionConstructorUninitializedAssignment) { 320 TEST_F(WeakHandleTest, TypeConversionConstructorUninitializedAssignment) {
321 WeakHandle<Base> base_weak_handle; 321 WeakHandle<Base> base_weak_handle;
322 base_weak_handle = WeakHandle<Derived>(); 322 base_weak_handle = WeakHandle<Derived>();
323 EXPECT_FALSE(base_weak_handle.IsInitialized()); 323 EXPECT_FALSE(base_weak_handle.IsInitialized());
324 } 324 }
325 325
326 } // namespace syncer 326 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/internal_api/public/base/cancelation_signal_unittest.cc ('k') | sync/internal_api/sync_context_proxy_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698