Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: content/public/test/test_renderer_host.h

Issue 2496233003: Destroy the old RenderWidgetHostView when swapping out a main frame. (Closed)
Patch Set: fix unit tests, remove dcheck Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ 5 #ifndef CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_
6 #define CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ 6 #define CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 }; 168 };
169 169
170 // You can instantiate only one class like this at a time. During its 170 // You can instantiate only one class like this at a time. During its
171 // lifetime, RenderViewHost and RenderFrameHost objects created may be used via 171 // lifetime, RenderViewHost and RenderFrameHost objects created may be used via
172 // RenderViewHostTester and RenderFrameHostTester respectively. 172 // RenderViewHostTester and RenderFrameHostTester respectively.
173 class RenderViewHostTestEnabler { 173 class RenderViewHostTestEnabler {
174 public: 174 public:
175 RenderViewHostTestEnabler(); 175 RenderViewHostTestEnabler();
176 ~RenderViewHostTestEnabler(); 176 ~RenderViewHostTestEnabler();
177 177
178 void SetUp();
Charlie Reis 2016/11/29 19:35:55 This needs a comment. Lots of classes instantiate
179 void TearDown();
180
178 private: 181 private:
179 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestEnabler); 182 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestEnabler);
180 friend class RenderViewHostTestHarness; 183 friend class RenderViewHostTestHarness;
181 184
185 #if defined(OS_ANDROID)
186 std::unique_ptr<MockGpuChannelEstablishFactory> gpu_channel_factory_;
187 std::unique_ptr<display::Screen> screen_;
188 #endif
182 std::unique_ptr<MockRenderProcessHostFactory> rph_factory_; 189 std::unique_ptr<MockRenderProcessHostFactory> rph_factory_;
183 std::unique_ptr<TestRenderViewHostFactory> rvh_factory_; 190 std::unique_ptr<TestRenderViewHostFactory> rvh_factory_;
184 std::unique_ptr<TestRenderFrameHostFactory> rfh_factory_; 191 std::unique_ptr<TestRenderFrameHostFactory> rfh_factory_;
185 }; 192 };
186 193
187 // RenderViewHostTestHarness --------------------------------------------------- 194 // RenderViewHostTestHarness ---------------------------------------------------
188 class RenderViewHostTestHarness : public testing::Test { 195 class RenderViewHostTestHarness : public testing::Test {
189 public: 196 public:
190 RenderViewHostTestHarness(); 197 RenderViewHostTestHarness();
191 ~RenderViewHostTestHarness() override; 198 ~RenderViewHostTestHarness() override;
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 280
274 std::unique_ptr<BrowserContext> browser_context_; 281 std::unique_ptr<BrowserContext> browser_context_;
275 282
276 std::unique_ptr<WebContents> contents_; 283 std::unique_ptr<WebContents> contents_;
277 #if defined(OS_WIN) 284 #if defined(OS_WIN)
278 std::unique_ptr<ui::ScopedOleInitializer> ole_initializer_; 285 std::unique_ptr<ui::ScopedOleInitializer> ole_initializer_;
279 #endif 286 #endif
280 #if defined(USE_AURA) 287 #if defined(USE_AURA)
281 std::unique_ptr<aura::test::AuraTestHelper> aura_test_helper_; 288 std::unique_ptr<aura::test::AuraTestHelper> aura_test_helper_;
282 #endif 289 #endif
283 #if defined(OS_ANDROID)
284 std::unique_ptr<MockGpuChannelEstablishFactory> gpu_channel_factory_;
285 std::unique_ptr<display::Screen> screen_;
286 #endif
287 RenderViewHostTestEnabler rvh_test_enabler_; 290 RenderViewHostTestEnabler rvh_test_enabler_;
288 291
289 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness); 292 DISALLOW_COPY_AND_ASSIGN(RenderViewHostTestHarness);
290 }; 293 };
291 294
292 } // namespace content 295 } // namespace content
293 296
294 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_ 297 #endif // CONTENT_PUBLIC_TEST_TEST_RENDERER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698