Convert env to a defaultdict in run_executable() to fix other callers of that function.
[chromium-blink-merge.git] / extensions / shell / test / shell_apitest.cc
blobb60bf5b1d1fa32adc2a27580c65c7bf355b75895
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 #include "extensions/shell/test/shell_apitest.h"
7 #include "base/files/file_path.h"
8 #include "base/path_service.h"
9 #include "extensions/common/extension_paths.h"
10 #include "extensions/shell/browser/shell_extension_system.h"
11 #include "extensions/test/result_catcher.h"
13 namespace extensions {
15 ShellApiTest::ShellApiTest() {
18 ShellApiTest::~ShellApiTest() {
21 bool ShellApiTest::RunAppTest(const std::string& app_dir) {
22 base::FilePath test_data_dir;
23 PathService::Get(extensions::DIR_TEST_DATA, &test_data_dir);
24 test_data_dir = test_data_dir.AppendASCII(app_dir);
25 ResultCatcher catcher;
27 bool loaded = extension_system_->LoadApp(test_data_dir);
28 if (!loaded)
29 return false;
31 extension_system_->LaunchApp();
33 if (!catcher.GetNextResult()) {
34 message_ = catcher.message();
35 return false;
38 return true;
41 } // namespace extensions