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

Side by Side Diff: mojo/shell/shell_test_helper.h

Issue 420143003: mojo: shell::Context should outlive the shell MessageLoop (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix + verify android Created 6 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 | Annotate | Revision Log
« no previous file with comments | « mojo/shell/shell_test_base.cc ('k') | mojo/shell/shell_test_helper.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 MOJO_SHELL_SHELL_TEST_HELPER_ 5 #ifndef MOJO_SHELL_SHELL_TEST_HELPER_
6 #define MOJO_SHELL_SHELL_TEST_HELPER_ 6 #define MOJO_SHELL_SHELL_TEST_HELPER_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 14 matching lines...) Expand all
25 // service_provider() returns the handle to the ServiceProvider. 25 // service_provider() returns the handle to the ServiceProvider.
26 class ShellTestHelper { 26 class ShellTestHelper {
27 public: 27 public:
28 ShellTestHelper(); 28 ShellTestHelper();
29 ~ShellTestHelper(); 29 ~ShellTestHelper();
30 30
31 void Init(); 31 void Init();
32 32
33 // Returns a handle to the ServiceManager. ShellTestHelper owns the 33 // Returns a handle to the ServiceManager. ShellTestHelper owns the
34 // ServiceProvider. 34 // ServiceProvider.
35 ServiceManager* service_manager() { return context_->service_manager(); } 35 ServiceManager* service_manager() { return context_.service_manager(); }
36 36
37 // Sets a ServiceLoader for the specified URL. |loader| is ultimately used on 37 // Sets a ServiceLoader for the specified URL. |loader| is ultimately used on
38 // the thread this class spawns. 38 // the thread this class spawns.
39 void SetLoaderForURL(scoped_ptr<ServiceLoader> loader, const GURL& url); 39 void SetLoaderForURL(scoped_ptr<ServiceLoader> loader, const GURL& url);
40 40
41 private: 41 private:
42 scoped_ptr<Context> context_; 42 Context context_;
43 base::MessageLoop shell_loop_;
43 scoped_ptr<ServiceManager::TestAPI> test_api_; 44 scoped_ptr<ServiceManager::TestAPI> test_api_;
44 DISALLOW_COPY_AND_ASSIGN(ShellTestHelper); 45 DISALLOW_COPY_AND_ASSIGN(ShellTestHelper);
45 }; 46 };
46 47
47 } // namespace shell 48 } // namespace shell
48 } // namespace mojo 49 } // namespace mojo
49 50
50 #endif // MOJO_SHELL_SHELL_TEST_HELPER_ 51 #endif // MOJO_SHELL_SHELL_TEST_HELPER_
OLDNEW
« no previous file with comments | « mojo/shell/shell_test_base.cc ('k') | mojo/shell/shell_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698