OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 PDFium 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 "core/fxcrt/include/cfx_count_ref.h" | 5 #include "core/fxcrt/cfx_count_ref.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "testing/fx_string_testhelpers.h" | 10 #include "testing/fx_string_testhelpers.h" |
11 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 class Observer { | 15 class Observer { |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 CFX_CountRef<Object> other(ptr); | 120 CFX_CountRef<Object> other(ptr); |
121 EXPECT_NE(nullptr, ptr.GetPrivateCopy(&observer, std::string("one"))); | 121 EXPECT_NE(nullptr, ptr.GetPrivateCopy(&observer, std::string("one"))); |
122 EXPECT_EQ(2, observer.GetConstructionCount("one")); | 122 EXPECT_EQ(2, observer.GetConstructionCount("one")); |
123 EXPECT_EQ(0, observer.GetDestructionCount("one")); | 123 EXPECT_EQ(0, observer.GetDestructionCount("one")); |
124 } | 124 } |
125 EXPECT_EQ(2, observer.GetConstructionCount("one")); | 125 EXPECT_EQ(2, observer.GetConstructionCount("one")); |
126 EXPECT_EQ(1, observer.GetDestructionCount("one")); | 126 EXPECT_EQ(1, observer.GetDestructionCount("one")); |
127 } | 127 } |
128 EXPECT_EQ(2, observer.GetDestructionCount("one")); | 128 EXPECT_EQ(2, observer.GetDestructionCount("one")); |
129 } | 129 } |
OLD | NEW |