OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/apps/app_browsertest_util.h" | 5 #include "chrome/browser/apps/app_browsertest_util.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "chrome/browser/apps/scoped_keep_alive.h" | 9 #include "chrome/browser/apps/scoped_keep_alive.h" |
10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 10 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
11 #include "chrome/browser/extensions/extension_function_test_utils.h" | 11 #include "chrome/browser/extensions/extension_function_test_utils.h" |
12 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | 12 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
13 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
14 #include "chrome/browser/ui/extensions/app_launch_params.h" | |
15 #include "chrome/browser/ui/extensions/application_launch.h" | 14 #include "chrome/browser/ui/extensions/application_launch.h" |
16 #include "content/public/browser/notification_service.h" | 15 #include "content/public/browser/notification_service.h" |
17 #include "content/public/test/browser_test_utils.h" | 16 #include "content/public/test/browser_test_utils.h" |
18 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
19 #include "extensions/browser/app_window/app_window_contents.h" | 18 #include "extensions/browser/app_window/app_window_contents.h" |
20 #include "extensions/browser/app_window/app_window_registry.h" | 19 #include "extensions/browser/app_window/app_window_registry.h" |
21 #include "extensions/browser/app_window/native_app_window.h" | 20 #include "extensions/browser/app_window/native_app_window.h" |
22 #include "extensions/browser/process_manager.h" | 21 #include "extensions/browser/process_manager.h" |
23 #include "extensions/common/constants.h" | |
24 #include "extensions/common/switches.h" | 22 #include "extensions/common/switches.h" |
25 #include "extensions/test/extension_test_message_listener.h" | 23 #include "extensions/test/extension_test_message_listener.h" |
26 | 24 |
27 using content::WebContents; | 25 using content::WebContents; |
28 | 26 |
29 namespace { | 27 namespace { |
30 | 28 |
31 const char kAppWindowTestApp[] = "app_window/generic"; | 29 const char kAppWindowTestApp[] = "app_window/generic"; |
32 | 30 |
33 } // namespace | 31 } // namespace |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 const Extension* extension = InstallPlatformApp(name); | 105 const Extension* extension = InstallPlatformApp(name); |
108 | 106 |
109 LaunchPlatformApp(extension); | 107 LaunchPlatformApp(extension); |
110 | 108 |
111 app_loaded_observer.Wait(); | 109 app_loaded_observer.Wait(); |
112 | 110 |
113 return extension; | 111 return extension; |
114 } | 112 } |
115 | 113 |
116 void PlatformAppBrowserTest::LaunchPlatformApp(const Extension* extension) { | 114 void PlatformAppBrowserTest::LaunchPlatformApp(const Extension* extension) { |
117 OpenApplication(AppLaunchParams(browser()->profile(), extension, | 115 OpenApplication(AppLaunchParams( |
118 LAUNCH_CONTAINER_NONE, NEW_WINDOW, | 116 browser()->profile(), extension, LAUNCH_CONTAINER_NONE, NEW_WINDOW)); |
119 extensions::SOURCE_UNTRACKED)); | |
120 } | 117 } |
121 | 118 |
122 WebContents* PlatformAppBrowserTest::GetFirstAppWindowWebContents() { | 119 WebContents* PlatformAppBrowserTest::GetFirstAppWindowWebContents() { |
123 AppWindow* window = GetFirstAppWindow(); | 120 AppWindow* window = GetFirstAppWindow(); |
124 if (window) | 121 if (window) |
125 return window->web_contents(); | 122 return window->web_contents(); |
126 | 123 |
127 return NULL; | 124 return NULL; |
128 } | 125 } |
129 | 126 |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 return app_window; | 252 return app_window; |
256 } | 253 } |
257 | 254 |
258 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( | 255 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( |
259 CommandLine* command_line) { | 256 CommandLine* command_line) { |
260 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 257 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
261 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 258 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
262 } | 259 } |
263 | 260 |
264 } // namespace extensions | 261 } // namespace extensions |
OLD | NEW |