OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef CONTENT_PUBLIC_TEST_TEST_WEB_CONTENTS_FACTORY_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_WEB_CONTENTS_FACTORY_H_ |
6 #define CONTENT_PUBLIC_TEST_TEST_WEB_CONTENTS_FACTORY_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_WEB_CONTENTS_FACTORY_H_ |
7 | 7 |
| 8 #include <memory> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "base/memory/scoped_vector.h" | 11 #include "base/memory/scoped_vector.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 class BrowserContext; | 14 class BrowserContext; |
14 class RenderViewHostTestEnabler; | 15 class RenderViewHostTestEnabler; |
15 class WebContents; | 16 class WebContents; |
16 | 17 |
17 // A helper class to create test web contents (tabs) for unit tests, without | 18 // A helper class to create test web contents (tabs) for unit tests, without |
18 // inheriting from RenderViewTestHarness. Can create web contents, and will | 19 // inheriting from RenderViewTestHarness. Can create web contents, and will |
19 // clean up after itself upon destruction. Owns all created web contents. | 20 // clean up after itself upon destruction. Owns all created web contents. |
(...skipping 10 matching lines...) Expand all Loading... |
30 public: | 31 public: |
31 TestWebContentsFactory(); | 32 TestWebContentsFactory(); |
32 ~TestWebContentsFactory(); | 33 ~TestWebContentsFactory(); |
33 | 34 |
34 // Creates a new WebContents with the given |context|, and returns it. | 35 // Creates a new WebContents with the given |context|, and returns it. |
35 // Ownership remains with the TestWebContentsFactory. | 36 // Ownership remains with the TestWebContentsFactory. |
36 WebContents* CreateWebContents(BrowserContext* context); | 37 WebContents* CreateWebContents(BrowserContext* context); |
37 | 38 |
38 private: | 39 private: |
39 // The test factory (and friends) for creating test web contents. | 40 // The test factory (and friends) for creating test web contents. |
40 scoped_ptr<RenderViewHostTestEnabler> rvh_enabler_; | 41 std::unique_ptr<RenderViewHostTestEnabler> rvh_enabler_; |
41 | 42 |
42 // The vector of web contents that this class created. | 43 // The vector of web contents that this class created. |
43 ScopedVector<WebContents> web_contents_; | 44 ScopedVector<WebContents> web_contents_; |
44 | 45 |
45 DISALLOW_COPY_AND_ASSIGN(TestWebContentsFactory); | 46 DISALLOW_COPY_AND_ASSIGN(TestWebContentsFactory); |
46 }; | 47 }; |
47 | 48 |
48 } // namespace content | 49 } // namespace content |
49 | 50 |
50 #endif // CONTENT_PUBLIC_TEST_TEST_WEB_CONTENTS_FACTORY_H_ | 51 #endif // CONTENT_PUBLIC_TEST_TEST_WEB_CONTENTS_FACTORY_H_ |
OLD | NEW |