blob: e842e61e4a5aa1f518d40ddebf6d5d038578bc19 [file] [log] [blame]
Viet-Trung Luucf6436b2015-04-07 12:32:41 -07001// 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 Luua168f472015-04-07 14:07:54 -07009#include "build/build_config.h"
James Robinson94ade6b2015-08-25 13:02:06 -070010#include "mojo/message_pump/message_pump_mojo.h"
Viet-Trung Luucf6436b2015-04-07 12:32:41 -070011#include "testing/gtest/include/gtest/gtest.h"
12
Viet-Trung Luucf6436b2015-04-07 12:32:41 -070013namespace shell {
14namespace {
15
Viet-Trung Luua168f472015-04-07 14:07:54 -070016#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
24TEST(ContextTest, MAYBE_Paths) {
Viet-Trung Luucf6436b2015-04-07 12:32:41 -070025 Context context;
26 base::MessageLoop message_loop(
Viet-Trung Luubd07e3a2015-04-09 12:43:29 -070027 scoped_ptr<base::MessagePump>(new mojo::common::MessagePumpMojo()));
Viet-Trung Luucf6436b2015-04-07 12:32:41 -070028 context.Init();
29
Viet-Trung Luucf6436b2015-04-07 12:32:41 -070030 EXPECT_FALSE(context.mojo_shell_child_path().empty());
Viet-Trung Luucf6436b2015-04-07 12:32:41 -070031 EXPECT_TRUE(context.mojo_shell_child_path().IsAbsolute());
32
33 context.Shutdown();
34}
35
36} // namespace
37} // namespace shell