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

Side by Side Diff: mojo/runner/shell_test_base.h

Issue 1435063002: Eliminate third_party/mojo/src from all targets' include paths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 1 month 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/runner/host/native_application_support.cc ('k') | mojo/runner/shell_test_base_unittest.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_RUNNER_SHELL_TEST_BASE_H_
6 #define MOJO_RUNNER_SHELL_TEST_BASE_H_
7
8 #include <string>
9
10 #include "base/macros.h"
11 #include "base/message_loop/message_loop.h"
12 #include "mojo/runner/context.h"
13 #include "testing/gtest/include/gtest/gtest.h"
14 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_ptr_info.h"
15 #include "third_party/mojo/src/mojo/public/cpp/system/core.h"
16
17 class GURL;
18
19 namespace mojo {
20 namespace runner {
21 namespace test {
22
23 class ShellTestBase : public testing::Test {
24 public:
25 ShellTestBase();
26 ~ShellTestBase() override;
27
28 void SetUp() override;
29 void TearDown() override;
30
31 // |application_url| should typically be a mojo: URL (the origin will be set
32 // to an "appropriate" file: URL).
33 // TODO(tim): Should the test base be a ServiceProvider?
34 ScopedMessagePipeHandle ConnectToService(const GURL& application_url,
35 const std::string& service_name);
36
37 template <typename Interface>
38 void ConnectToService(const GURL& application_url,
39 InterfacePtr<Interface>* ptr) {
40 ptr->Bind(InterfacePtrInfo<Interface>(
41 ConnectToService(application_url, Interface::Name_).Pass(), 0u));
42 }
43
44 base::MessageLoop* message_loop() { return &message_loop_; }
45 Context* shell_context() { return &shell_context_; }
46
47 private:
48 base::FilePath GetTestAppFilePath() const;
49
50 Context shell_context_;
51 base::MessageLoop message_loop_;
52
53 DISALLOW_COPY_AND_ASSIGN(ShellTestBase);
54 };
55
56 } // namespace test
57 } // namespace runner
58 } // namespace mojo
59
60 #endif // MOJO_RUNNER_SHELL_TEST_BASE_H_
OLDNEW
« no previous file with comments | « mojo/runner/host/native_application_support.cc ('k') | mojo/runner/shell_test_base_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698