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/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/run_loop.h" | 13 #include "base/run_loop.h" |
14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
15 #include "components/version_info/version_info.h" | |
16 #include "content/public/common/content_switches.h" | 15 #include "content/public/common/content_switches.h" |
17 #include "extensions/browser/extension_system.h" | 16 #include "extensions/browser/extension_system.h" |
18 #include "extensions/shell/browser/desktop_controller.h" | 17 #include "extensions/shell/browser/desktop_controller.h" |
19 #include "extensions/shell/browser/shell_content_browser_client.h" | 18 #include "extensions/shell/browser/shell_content_browser_client.h" |
20 #include "extensions/shell/browser/shell_extension_system.h" | 19 #include "extensions/shell/browser/shell_extension_system.h" |
21 | 20 |
22 namespace extensions { | 21 namespace extensions { |
23 | 22 |
24 AppShellTest::AppShellTest() | 23 AppShellTest::AppShellTest() |
25 : browser_context_(nullptr), | 24 : browser_context_(nullptr), |
26 extension_system_(nullptr), | 25 extension_system_(nullptr) { |
27 // Default channel is STABLE but override with UNKNOWN so that unlaunched | |
28 // or incomplete APIs can write tests. | |
29 current_channel_(version_info::Channel::UNKNOWN) { | |
30 #if defined(OS_MACOSX) | 26 #if defined(OS_MACOSX) |
31 // TODO(phajdan.jr): Make browser tests self-contained on Mac; remove this. | 27 // TODO(phajdan.jr): Make browser tests self-contained on Mac; remove this. |
32 // Set up the application path as though we we are inside the App Shell.app | 28 // Set up the application path as though we we are inside the App Shell.app |
33 // bundle, rather than the top-level extensions_browsertests, because we | 29 // bundle, rather than the top-level extensions_browsertests, because we |
34 // make many assumptions about where the executable is located. | 30 // make many assumptions about where the executable is located. |
35 base::FilePath app_shell_path; | 31 base::FilePath app_shell_path; |
36 CHECK(PathService::Get(base::FILE_EXE, &app_shell_path)); | 32 CHECK(PathService::Get(base::FILE_EXE, &app_shell_path)); |
37 app_shell_path = app_shell_path.DirName(); | 33 app_shell_path = app_shell_path.DirName(); |
38 app_shell_path = app_shell_path.Append( | 34 app_shell_path = app_shell_path.Append( |
39 FILE_PATH_LITERAL("App Shell.app/Contents/MacOS/App Shell")); | 35 FILE_PATH_LITERAL("App Shell.app/Contents/MacOS/App Shell")); |
(...skipping 27 matching lines...) Expand all Loading... |
67 | 63 |
68 RunTestOnMainThread(); | 64 RunTestOnMainThread(); |
69 | 65 |
70 TearDownOnMainThread(); | 66 TearDownOnMainThread(); |
71 | 67 |
72 // Clean up the app window. | 68 // Clean up the app window. |
73 DesktopController::instance()->CloseAppWindows(); | 69 DesktopController::instance()->CloseAppWindows(); |
74 } | 70 } |
75 | 71 |
76 } // namespace extensions | 72 } // namespace extensions |
OLD | NEW |