OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "apps/test/app_shell_test.h" | |
6 | |
7 #include "apps/shell/browser/shell_content_browser_client.h" | |
8 #include "apps/shell/browser/shell_extension_system.h" | |
9 #include "base/files/file_path.h" | |
10 #include "base/logging.h" | |
11 #include "extensions/browser/extension_system.h" | |
12 | |
13 namespace apps { | |
14 | |
15 AppShellTest::AppShellTest() | |
16 : browser_context_(NULL), extension_system_(NULL) {} | |
17 | |
18 AppShellTest::~AppShellTest() {} | |
19 | |
20 void AppShellTest::SetUpOnMainThread() { | |
21 browser_context_ = ShellContentBrowserClient::Get()->GetBrowserContext(); | |
22 | |
23 extension_system_ = static_cast<extensions::ShellExtensionSystem*>( | |
24 extensions::ExtensionSystem::Get(browser_context_)); | |
25 } | |
26 | |
27 void AppShellTest::RunTestOnMainThreadLoop() { | |
28 // Pump startup related events. | |
29 base::MessageLoopForUI::current()->RunUntilIdle(); | |
30 | |
31 SetUpOnMainThread(); | |
32 | |
33 RunTestOnMainThread(); | |
34 | |
35 TearDownOnMainThread(); | |
36 } | |
37 | |
38 bool AppShellTest::LoadAndLaunchApp(const base::FilePath& app_dir) { | |
39 return extension_system_->LoadAndLaunchApp(app_dir); | |
40 } | |
41 | |
42 } // namespace apps | |
OLD | NEW |