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_test.h"
7 #include "base/command_line.h"
8 #include "base/logging.h"
9 #include "content/public/common/content_switches.h"
10 #include "extensions/browser/extension_system.h"
11 #include "extensions/shell/browser/shell_content_browser_client.h"
12 #include "extensions/shell/browser/shell_desktop_controller.h"
13 #include "extensions/shell/browser/shell_extension_system.h"
15 namespace extensions {
17 AppShellTest::AppShellTest() : browser_context_(NULL), extension_system_(NULL) {
20 AppShellTest::~AppShellTest() {
23 void AppShellTest::SetUp() {
24 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
25 command_line->AppendSwitchASCII(switches::kTestType, "appshell");
26 content::BrowserTestBase::SetUp();
29 void AppShellTest::SetUpOnMainThread() {
30 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext();
32 extension_system_ = static_cast<ShellExtensionSystem*>(
33 ExtensionSystem::Get(browser_context_));
36 void AppShellTest::RunTestOnMainThreadLoop() {
37 base::MessageLoopForUI::current()->RunUntilIdle();
41 RunTestOnMainThread();
43 TearDownOnMainThread();
45 // Clean up the app window.
46 ShellDesktopController::instance()->CloseAppWindows();
49 } // namespace extensions