| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "shell/context.h" | 5 #include "shell/context.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "build/build_config.h" |
| 9 #include "mojo/common/message_pump_mojo.h" | 10 #include "mojo/common/message_pump_mojo.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 | 12 |
| 12 namespace mojo { | 13 namespace mojo { |
| 13 namespace shell { | 14 namespace shell { |
| 14 namespace { | 15 namespace { |
| 15 | 16 |
| 16 TEST(ContextTest, Paths) { | 17 #if defined(OS_ANDROID) |
| 18 // TODO(vtl): The command line doesn't get initialized in a reasonable way on |
| 19 // Android, currently. (Relatedly, multiprocess tests are currently not |
| 20 // supported.) |
| 21 #define MAYBE_Paths DISABLED_Paths |
| 22 #else |
| 23 #define MAYBE_Paths Paths |
| 24 #endif |
| 25 TEST(ContextTest, MAYBE_Paths) { |
| 17 Context context; | 26 Context context; |
| 18 base::MessageLoop message_loop( | 27 base::MessageLoop message_loop( |
| 19 scoped_ptr<base::MessagePump>(new common::MessagePumpMojo())); | 28 scoped_ptr<base::MessagePump>(new common::MessagePumpMojo())); |
| 20 context.Init(); | 29 context.Init(); |
| 21 | 30 |
| 22 EXPECT_FALSE(context.mojo_shell_path().empty()); | 31 EXPECT_FALSE(context.mojo_shell_path().empty()); |
| 23 EXPECT_FALSE(context.mojo_shell_child_path().empty()); | 32 EXPECT_FALSE(context.mojo_shell_child_path().empty()); |
| 24 EXPECT_TRUE(context.mojo_shell_path().IsAbsolute()); | 33 EXPECT_TRUE(context.mojo_shell_path().IsAbsolute()); |
| 25 EXPECT_TRUE(context.mojo_shell_child_path().IsAbsolute()); | 34 EXPECT_TRUE(context.mojo_shell_child_path().IsAbsolute()); |
| 26 | 35 |
| 27 context.Shutdown(); | 36 context.Shutdown(); |
| 28 } | 37 } |
| 29 | 38 |
| 30 } // namespace | 39 } // namespace |
| 31 } // namespace shell | 40 } // namespace shell |
| 32 } // namespace mojo | 41 } // namespace mojo |
| OLD | NEW |