OLD | NEW |
---|---|
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 "ash/shelf/scoped_observer_with_duplicated_sources.h" | 5 #include "ash/shelf/scoped_observer_with_duplicated_sources.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include <memory> |
oshima
2016/04/08 07:09:41
remove this?
| |
8 | |
8 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
9 | 10 |
10 class TestObserver { | 11 class TestObserver { |
11 public: | 12 public: |
12 TestObserver() {} | 13 TestObserver() {} |
13 ~TestObserver() {} | 14 ~TestObserver() {} |
14 | 15 |
15 private: | 16 private: |
16 DISALLOW_COPY_AND_ASSIGN(TestObserver); | 17 DISALLOW_COPY_AND_ASSIGN(TestObserver); |
17 }; | 18 }; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 observers.Remove(&source2); | 74 observers.Remove(&source2); |
74 EXPECT_EQ(0, source2.GetObserverCount()); | 75 EXPECT_EQ(0, source2.GetObserverCount()); |
75 EXPECT_FALSE(observers.IsObserving(&source2)); | 76 EXPECT_FALSE(observers.IsObserving(&source2)); |
76 | 77 |
77 // Remove |source1| again. | 78 // Remove |source1| again. |
78 observers.Remove(&source1); | 79 observers.Remove(&source1); |
79 // In this time, |observer| is removed from |source1|. | 80 // In this time, |observer| is removed from |source1|. |
80 EXPECT_EQ(0, source1.GetObserverCount()); | 81 EXPECT_EQ(0, source1.GetObserverCount()); |
81 EXPECT_FALSE(observers.IsObserving(&source1)); | 82 EXPECT_FALSE(observers.IsObserving(&source1)); |
82 } | 83 } |
OLD | NEW |