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