| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 "extensions/shell/test/shell_test.h" | 5 #include "extensions/shell/test/shell_test.h" |
| 6 | 6 |
| 7 #include "base/base_paths.h" |
| 7 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/path_service.h" |
| 9 #include "content/public/common/content_switches.h" | 12 #include "content/public/common/content_switches.h" |
| 10 #include "extensions/browser/extension_system.h" | 13 #include "extensions/browser/extension_system.h" |
| 11 #include "extensions/shell/browser/desktop_controller.h" | 14 #include "extensions/shell/browser/desktop_controller.h" |
| 12 #include "extensions/shell/browser/shell_content_browser_client.h" | 15 #include "extensions/shell/browser/shell_content_browser_client.h" |
| 13 #include "extensions/shell/browser/shell_extension_system.h" | 16 #include "extensions/shell/browser/shell_extension_system.h" |
| 14 | 17 |
| 15 namespace extensions { | 18 namespace extensions { |
| 16 | 19 |
| 17 AppShellTest::AppShellTest() : browser_context_(NULL), extension_system_(NULL) { | 20 AppShellTest::AppShellTest() : browser_context_(NULL), extension_system_(NULL) { |
| 21 #if defined(OS_MACOSX) |
| 22 base::FilePath app_shell_path; |
| 23 CHECK(PathService::Get(base::FILE_EXE, &app_shell_path)); |
| 24 app_shell_path = app_shell_path.DirName(); |
| 25 app_shell_path = app_shell_path.Append( |
| 26 FILE_PATH_LITERAL("App Shell.app/Contents/MacOS/App Shell")); |
| 27 CHECK(PathService::Override(base::FILE_EXE, app_shell_path)); |
| 28 #endif |
| 18 } | 29 } |
| 19 | 30 |
| 20 AppShellTest::~AppShellTest() { | 31 AppShellTest::~AppShellTest() { |
| 21 } | 32 } |
| 22 | 33 |
| 23 void AppShellTest::SetUp() { | 34 void AppShellTest::SetUp() { |
| 24 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 35 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 25 command_line->AppendSwitchASCII(switches::kTestType, "appshell"); | 36 command_line->AppendSwitchASCII(switches::kTestType, "appshell"); |
| 26 SetUpCommandLine(command_line); | 37 SetUpCommandLine(command_line); |
| 27 content::BrowserTestBase::SetUp(); | 38 content::BrowserTestBase::SetUp(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 41 | 52 |
| 42 RunTestOnMainThread(); | 53 RunTestOnMainThread(); |
| 43 | 54 |
| 44 TearDownOnMainThread(); | 55 TearDownOnMainThread(); |
| 45 | 56 |
| 46 // Clean up the app window. | 57 // Clean up the app window. |
| 47 DesktopController::instance()->CloseAppWindows(); | 58 DesktopController::instance()->CloseAppWindows(); |
| 48 } | 59 } |
| 49 | 60 |
| 50 } // namespace extensions | 61 } // namespace extensions |
| OLD | NEW |