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

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

Issue 1049993002: Get mojo_shell building inside chromium checkout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix presubmit Created 5 years, 8 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 | « 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 SHELL_SHELL_TEST_HELPER_H_
6 #define SHELL_SHELL_TEST_HELPER_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/run_loop.h"
11 #include "mojo/shell/application_manager/application_loader.h"
12 #include "mojo/shell/context.h"
13
14 class GURL;
15
16 namespace mojo {
17 namespace shell {
18
19 // ShellTestHelper is useful for tests to establish a connection to the
20 // ApplicationManager. Invoke Init() to establish the connection. Once done,
21 // application_manager() returns the ApplicationManager.
22 class ShellTestHelper {
23 public:
24 ShellTestHelper();
25 ~ShellTestHelper();
26
27 void Init();
28
29 ApplicationManager* application_manager() {
30 return context_.application_manager();
31 }
32
33 // Sets a ApplicationLoader for the specified URL. |loader| is ultimately used
34 // on
35 // the thread this class spawns.
36 void SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, const GURL& url);
37
38 // Adds a mapping that is used when resolving mojo urls. See URLResolver
39 // for details.
40 void AddURLMapping(const GURL& url, const GURL& resolved_url);
41
42 private:
43 Context context_;
44 base::MessageLoop shell_loop_;
45 scoped_ptr<ApplicationManager::TestAPI> test_api_;
46 DISALLOW_COPY_AND_ASSIGN(ShellTestHelper);
47 };
48
49 } // namespace shell
50 } // namespace mojo
51
52 #endif // SHELL_SHELL_TEST_HELPER_H_
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