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

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

Issue 2230283003: Revert of Establish MojoChildConnection from BrowserChildProcessHostImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@renderer-channel
Patch Set: Created 4 years, 4 months 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
« no previous file with comments | « content/public/test/test_mojo_shell_context.cc ('k') | content/public/test/test_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_UTILS_H_ 5 #ifndef CONTENT_PUBLIC_TEST_TEST_UTILS_H_
6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_ 6 #define CONTENT_PUBLIC_TEST_TEST_UTILS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 17 matching lines...) Expand all
28 namespace base { 28 namespace base {
29 class Value; 29 class Value;
30 class CommandLine; 30 class CommandLine;
31 } // namespace base 31 } // namespace base
32 32
33 // A collection of functions designed for use with unit and browser tests. 33 // A collection of functions designed for use with unit and browser tests.
34 34
35 namespace content { 35 namespace content {
36 36
37 class RenderFrameHost; 37 class RenderFrameHost;
38 class TestMojoShellContext;
39 38
40 // Turns on nestable tasks, runs the message loop, then resets nestable tasks 39 // Turns on nestable tasks, runs the message loop, then resets nestable tasks
41 // to what they were originally. Prefer this over MessageLoop::Run for in 40 // to what they were originally. Prefer this over MessageLoop::Run for in
42 // process browser tests that need to block until a condition is met. 41 // process browser tests that need to block until a condition is met.
43 void RunMessageLoop(); 42 void RunMessageLoop();
44 43
45 // Variant of RunMessageLoop that takes RunLoop. 44 // Variant of RunMessageLoop that takes RunLoop.
46 void RunThisRunLoop(base::RunLoop* run_loop); 45 void RunThisRunLoop(base::RunLoop* run_loop);
47 46
48 // Turns on nestable tasks, runs all pending tasks in the message loop, 47 // Turns on nestable tasks, runs all pending tasks in the message loop,
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 InProcessUtilityThreadHelper(); 233 InProcessUtilityThreadHelper();
235 ~InProcessUtilityThreadHelper() override; 234 ~InProcessUtilityThreadHelper() override;
236 235
237 private: 236 private:
238 void BrowserChildProcessHostConnected(const ChildProcessData& data) override; 237 void BrowserChildProcessHostConnected(const ChildProcessData& data) override;
239 void BrowserChildProcessHostDisconnected( 238 void BrowserChildProcessHostDisconnected(
240 const ChildProcessData& data) override; 239 const ChildProcessData& data) override;
241 240
242 int child_thread_count_; 241 int child_thread_count_;
243 scoped_refptr<MessageLoopRunner> runner_; 242 scoped_refptr<MessageLoopRunner> runner_;
244 std::unique_ptr<TestMojoShellContext> shell_context_;
245 243
246 DISALLOW_COPY_AND_ASSIGN(InProcessUtilityThreadHelper); 244 DISALLOW_COPY_AND_ASSIGN(InProcessUtilityThreadHelper);
247 }; 245 };
248 246
249 // This observer keeps track of the last deleted RenderFrame to avoid 247 // This observer keeps track of the last deleted RenderFrame to avoid
250 // accessing it and causing use-after-free condition. 248 // accessing it and causing use-after-free condition.
251 class RenderFrameDeletedObserver : public WebContentsObserver { 249 class RenderFrameDeletedObserver : public WebContentsObserver {
252 public: 250 public:
253 RenderFrameDeletedObserver(RenderFrameHost* rfh); 251 RenderFrameDeletedObserver(RenderFrameHost* rfh);
254 ~RenderFrameDeletedObserver() override; 252 ~RenderFrameDeletedObserver() override;
(...skipping 27 matching lines...) Expand all
282 void WebContentsDestroyed() override; 280 void WebContentsDestroyed() override;
283 281
284 scoped_refptr<MessageLoopRunner> message_loop_runner_; 282 scoped_refptr<MessageLoopRunner> message_loop_runner_;
285 283
286 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher); 284 DISALLOW_COPY_AND_ASSIGN(WebContentsDestroyedWatcher);
287 }; 285 };
288 286
289 } // namespace content 287 } // namespace content
290 288
291 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_ 289 #endif // CONTENT_PUBLIC_TEST_TEST_UTILS_H_
OLDNEW
« no previous file with comments | « content/public/test/test_mojo_shell_context.cc ('k') | content/public/test/test_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698