Viet-Trung Luu | cf6436b | 2015-04-07 12:32:41 -0700 | [diff] [blame] | 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 |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shell/context.h" |
| 6 | |
| 7 | #include "base/files/file_path.h" |
| 8 | #include "base/message_loop/message_loop.h" |
Viet-Trung Luu | a168f47 | 2015-04-07 14:07:54 -0700 | [diff] [blame] | 9 | #include "build/build_config.h" |
James Robinson | 94ade6b | 2015-08-25 13:02:06 -0700 | [diff] [blame] | 10 | #include "mojo/message_pump/message_pump_mojo.h" |
Viet-Trung Luu | cf6436b | 2015-04-07 12:32:41 -0700 | [diff] [blame] | 11 | #include "testing/gtest/include/gtest/gtest.h" |
| 12 | |
Viet-Trung Luu | cf6436b | 2015-04-07 12:32:41 -0700 | [diff] [blame] | 13 | namespace shell { |
| 14 | namespace { |
| 15 | |
Viet-Trung Luu | a168f47 | 2015-04-07 14:07:54 -0700 | [diff] [blame] | 16 | #if defined(OS_ANDROID) |
| 17 | // TODO(vtl): The command line doesn't get initialized in a reasonable way on |
| 18 | // Android, currently. (Relatedly, multiprocess tests are currently not |
| 19 | // supported.) |
| 20 | #define MAYBE_Paths DISABLED_Paths |
| 21 | #else |
| 22 | #define MAYBE_Paths Paths |
| 23 | #endif |
| 24 | TEST(ContextTest, MAYBE_Paths) { |
Viet-Trung Luu | cf6436b | 2015-04-07 12:32:41 -0700 | [diff] [blame] | 25 | Context context; |
| 26 | base::MessageLoop message_loop( |
Viet-Trung Luu | bd07e3a | 2015-04-09 12:43:29 -0700 | [diff] [blame] | 27 | scoped_ptr<base::MessagePump>(new mojo::common::MessagePumpMojo())); |
Viet-Trung Luu | cf6436b | 2015-04-07 12:32:41 -0700 | [diff] [blame] | 28 | context.Init(); |
| 29 | |
Viet-Trung Luu | cf6436b | 2015-04-07 12:32:41 -0700 | [diff] [blame] | 30 | EXPECT_FALSE(context.mojo_shell_child_path().empty()); |
Viet-Trung Luu | cf6436b | 2015-04-07 12:32:41 -0700 | [diff] [blame] | 31 | EXPECT_TRUE(context.mojo_shell_child_path().IsAbsolute()); |
| 32 | |
| 33 | context.Shutdown(); |
| 34 | } |
| 35 | |
| 36 | } // namespace |
| 37 | } // namespace shell |