Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: apps/test/app_shell_test.cc

Issue 205653002: Add apps_browsertests target (currently running 0 tests). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win gyp fix Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « apps/test/app_shell_test.h ('k') | apps/test/apps_test_launcher_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/apps_client.h"
8 #include "apps/shell/browser/shell_browser_context.h"
9 #include "apps/shell/browser/shell_extension_system.h"
10 #include "apps/shell/browser/shell_extension_system_factory.h"
11 #include "base/files/file_path.h"
12 #include "base/logging.h"
13 #include "components/keyed_service/content/browser_context_dependency_manager.h"
14 #include "extensions/browser/extension_system.h"
15 #include "extensions/common/extension_paths.h"
16
17 namespace apps {
18
19 AppShellTest::AppShellTest() {}
20
21 AppShellTest::~AppShellTest() {}
22
23 void AppShellTest::SetUpOnMainThread() {
24 std::vector<content::BrowserContext*> contexts =
25 AppsClient::Get()->GetLoadedBrowserContexts();
26 CHECK_EQ(1U, contexts.size());
27 browser_context_ = contexts[0];
28
29 extension_system_ = static_cast<extensions::ShellExtensionSystem*>(
30 extensions::ExtensionSystem::Get(browser_context_));
31 }
32
33 void AppShellTest::RunTestOnMainThreadLoop() {
34 // Pump startup related events.
35 base::MessageLoopForUI::current()->RunUntilIdle();
36
37 SetUpOnMainThread();
38
39 RunTestOnMainThread();
40
41 TearDownOnMainThread();
42
43 // TODO(yoz): Make windows close. This doesn't seem to close the root window.
44 extension_system_->CloseApp();
45 }
46
47 bool AppShellTest::LoadAndLaunchApp(const base::FilePath& app_dir) {
48 return extension_system_->LoadAndLaunchApp(app_dir);
49 }
50
51 } // namespace apps
OLDNEW
« no previous file with comments | « apps/test/app_shell_test.h ('k') | apps/test/apps_test_launcher_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698