| OLD | NEW |
| 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 "extensions/browser/api/declarative/deduping_factory.h" | 5 #include "extensions/browser/api/declarative/deduping_factory.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/values.h" | 9 #include "base/values.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 11 namespace { | 12 namespace { |
| 12 | 13 |
| 13 const char kTypeName[] = "Foo"; | 14 const char kTypeName[] = "Foo"; |
| 14 const char kTypeName2[] = "Foo2"; | 15 const char kTypeName2[] = "Foo2"; |
| 15 | 16 |
| 16 // This serves as an example how to use the DedupingFactory. | 17 // This serves as an example how to use the DedupingFactory. |
| 17 class BaseClass : public base::RefCounted<BaseClass> { | 18 class BaseClass : public base::RefCounted<BaseClass> { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 192 |
| 192 scoped_refptr<const BaseClass> c1_b( | 193 scoped_refptr<const BaseClass> c1_b( |
| 193 factory.Instantiate(kTypeName, d1.get(), &error, &bad_message)); | 194 factory.Instantiate(kTypeName, d1.get(), &error, &bad_message)); |
| 194 | 195 |
| 195 ASSERT_TRUE(c1_a.get()); | 196 ASSERT_TRUE(c1_a.get()); |
| 196 ASSERT_TRUE(c1_b.get()); | 197 ASSERT_TRUE(c1_b.get()); |
| 197 EXPECT_NE(c1_a, c1_b); | 198 EXPECT_NE(c1_a, c1_b); |
| 198 } | 199 } |
| 199 | 200 |
| 200 } // namespace extensions | 201 } // namespace extensions |
| OLD | NEW |