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

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

Issue 775343004: Move //mojo/shell to //shell (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
« no previous file with comments | « mojo/shell/shell_test_base_unittest.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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_SHELL_SHELL_TEST_HELPER_
6 #define MOJO_SHELL_SHELL_TEST_HELPER_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h"
11 #include "mojo/application_manager/application_loader.h"
12 #include "mojo/shell/context.h"
13
14 class GURL;
15
16 namespace mojo {
17
18 class ApplicationLoader;
19
20 namespace shell {
21
22 // ShellTestHelper is useful for tests to establish a connection to the
23 // ApplicationManager. Invoke Init() to establish the connection. Once done,
24 // application_manager() returns the ApplicationManager.
25 class ShellTestHelper {
26 public:
27 ShellTestHelper();
28 ~ShellTestHelper();
29
30 void Init();
31
32 ApplicationManager* application_manager() {
33 return context_.application_manager();
34 }
35
36 // Sets a ApplicationLoader for the specified URL. |loader| is ultimately used
37 // on
38 // the thread this class spawns.
39 void SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, const GURL& url);
40
41 // Adds a mapping that is used when resolving mojo urls. See MojoURLResolver
42 // for details.
43 void AddCustomMapping(const GURL& mojo_url, const GURL& resolved_url);
44
45 private:
46 Context context_;
47 base::MessageLoop shell_loop_;
48 scoped_ptr<ApplicationManager::TestAPI> test_api_;
49 DISALLOW_COPY_AND_ASSIGN(ShellTestHelper);
50 };
51
52 } // namespace shell
53 } // namespace mojo
54
55 #endif // MOJO_SHELL_SHELL_TEST_HELPER_
OLDNEW
« no previous file with comments | « mojo/shell/shell_test_base_unittest.cc ('k') | mojo/shell/shell_test_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698