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 "apps/app_window_contents.h" | 7 #include "apps/app_window_contents.h" |
8 #include "apps/app_window_registry.h" | 8 #include "apps/app_window_registry.h" |
9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
12 #include "chrome/browser/extensions/api/tabs/tabs_api.h" | 12 #include "chrome/browser/extensions/api/tabs/tabs_api.h" |
13 #include "chrome/browser/extensions/extension_function_test_utils.h" | 13 #include "chrome/browser/extensions/extension_function_test_utils.h" |
14 #include "chrome/browser/extensions/extension_test_message_listener.h" | 14 #include "chrome/browser/extensions/extension_test_message_listener.h" |
15 #include "chrome/browser/ui/apps/chrome_app_delegate.h" | 15 #include "chrome/browser/ui/apps/chrome_app_delegate.h" |
16 #include "chrome/browser/ui/apps/chrome_app_window_delegate.h" | |
17 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
18 #include "chrome/browser/ui/extensions/application_launch.h" | 17 #include "chrome/browser/ui/extensions/application_launch.h" |
19 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
20 #include "content/public/test/browser_test_utils.h" | 19 #include "content/public/test/browser_test_utils.h" |
21 #include "content/public/test/test_utils.h" | 20 #include "content/public/test/test_utils.h" |
22 #include "extensions/common/switches.h" | 21 #include "extensions/common/switches.h" |
23 | 22 |
24 using apps::AppWindow; | 23 using apps::AppWindow; |
25 using apps::AppWindowRegistry; | 24 using apps::AppWindowRegistry; |
26 using content::WebContents; | 25 using content::WebContents; |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 command_line->AppendArgPath(test_doc); | 194 command_line->AppendArgPath(test_doc); |
196 } | 195 } |
197 | 196 |
198 AppWindow* PlatformAppBrowserTest::CreateAppWindow(const Extension* extension) { | 197 AppWindow* PlatformAppBrowserTest::CreateAppWindow(const Extension* extension) { |
199 return CreateAppWindowFromParams(extension, AppWindow::CreateParams()); | 198 return CreateAppWindowFromParams(extension, AppWindow::CreateParams()); |
200 } | 199 } |
201 | 200 |
202 AppWindow* PlatformAppBrowserTest::CreateAppWindowFromParams( | 201 AppWindow* PlatformAppBrowserTest::CreateAppWindowFromParams( |
203 const Extension* extension, | 202 const Extension* extension, |
204 const AppWindow::CreateParams& params) { | 203 const AppWindow::CreateParams& params) { |
205 AppWindow* window = new AppWindow(browser()->profile(), | 204 AppWindow* window = |
206 new ChromeAppDelegate(), | 205 new AppWindow(browser()->profile(), new ChromeAppDelegate(), extension); |
207 new ChromeAppWindowDelegate(), | |
208 extension); | |
209 window->Init( | 206 window->Init( |
210 GURL(std::string()), new apps::AppWindowContentsImpl(window), params); | 207 GURL(std::string()), new apps::AppWindowContentsImpl(window), params); |
211 return window; | 208 return window; |
212 } | 209 } |
213 | 210 |
214 void PlatformAppBrowserTest::CloseAppWindow(AppWindow* window) { | 211 void PlatformAppBrowserTest::CloseAppWindow(AppWindow* window) { |
215 content::WebContentsDestroyedWatcher destroyed_watcher( | 212 content::WebContentsDestroyedWatcher destroyed_watcher( |
216 window->web_contents()); | 213 window->web_contents()); |
217 window->GetBaseWindow()->Close(); | 214 window->GetBaseWindow()->Close(); |
218 destroyed_watcher.Wait(); | 215 destroyed_watcher.Wait(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 return app_window; | 251 return app_window; |
255 } | 252 } |
256 | 253 |
257 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( | 254 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( |
258 CommandLine* command_line) { | 255 CommandLine* command_line) { |
259 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 256 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
260 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 257 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
261 } | 258 } |
262 | 259 |
263 } // namespace extensions | 260 } // namespace extensions |
OLD | NEW |