[DevTools] Implement DevToolsManager::Observer which notifies about target updates.
[chromium-blink-merge.git] / mojo / shell / shell_test_helper.h
blob38fb008a7b9a88c9d1636ae77bafc452af6473bf
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.
5 #ifndef MOJO_SHELL_SHELL_TEST_HELPER_
6 #define MOJO_SHELL_SHELL_TEST_HELPER_
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"
14 class GURL;
16 namespace mojo {
18 class ApplicationLoader;
20 namespace shell {
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();
30 void Init();
32 ApplicationManager* application_manager() {
33 return context_.application_manager();
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);
41 private:
42 Context context_;
43 base::MessageLoop shell_loop_;
44 scoped_ptr<ApplicationManager::TestAPI> test_api_;
45 DISALLOW_COPY_AND_ASSIGN(ShellTestHelper);
48 } // namespace shell
49 } // namespace mojo
51 #endif // MOJO_SHELL_SHELL_TEST_HELPER_