OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/platform_app_browsertest_util.h" | 5 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
6 | 6 |
7 #include "apps/app_window_contents.h" | 7 #include "apps/app_window_contents.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.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/extensions/shell_window_registry.h" | 12 #include "chrome/browser/extensions/shell_window_registry.h" |
13 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h" | 13 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h" |
14 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
15 #include "chrome/browser/ui/extensions/application_launch.h" | 15 #include "chrome/browser/ui/extensions/application_launch.h" |
16 #include "chrome/browser/ui/extensions/native_app_window.h" | 16 #include "chrome/browser/ui/extensions/native_app_window.h" |
17 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
18 #include "content/public/browser/notification_service.h" | 18 #include "content/public/browser/notification_service.h" |
19 #include "content/public/test/test_utils.h" | 19 #include "content/public/test/test_utils.h" |
| 20 #include "extensions/common/switches.h" |
20 | 21 |
21 using apps::ShellWindow; | 22 using apps::ShellWindow; |
22 using content::WebContents; | 23 using content::WebContents; |
23 | 24 |
24 namespace utils = extension_function_test_utils; | 25 namespace utils = extension_function_test_utils; |
25 | 26 |
26 namespace extensions { | 27 namespace extensions { |
27 | 28 |
28 PlatformAppBrowserTest::PlatformAppBrowserTest() { | 29 PlatformAppBrowserTest::PlatformAppBrowserTest() { |
29 chrome::ChromeShellWindowDelegate::DisableExternalOpenForTesting(); | 30 chrome::ChromeShellWindowDelegate::DisableExternalOpenForTesting(); |
30 } | 31 } |
31 | 32 |
32 void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 33 void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
33 // Skips ExtensionApiTest::SetUpCommandLine. | 34 // Skips ExtensionApiTest::SetUpCommandLine. |
34 ExtensionBrowserTest::SetUpCommandLine(command_line); | 35 ExtensionBrowserTest::SetUpCommandLine(command_line); |
35 | 36 |
36 // Make event pages get suspended quicker. | 37 // Make event pages get suspended quicker. |
37 command_line->AppendSwitchASCII(switches::kEventPageIdleTime, "1"); | 38 command_line->AppendSwitchASCII(::switches::kEventPageIdleTime, "1"); |
38 command_line->AppendSwitchASCII(switches::kEventPageSuspendingTime, "1"); | 39 command_line->AppendSwitchASCII(::switches::kEventPageSuspendingTime, "1"); |
39 } | 40 } |
40 | 41 |
41 const Extension* PlatformAppBrowserTest::LoadAndLaunchPlatformApp( | 42 const Extension* PlatformAppBrowserTest::LoadAndLaunchPlatformApp( |
42 const char* name) { | 43 const char* name) { |
43 content::WindowedNotificationObserver app_loaded_observer( | 44 content::WindowedNotificationObserver app_loaded_observer( |
44 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 45 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
45 content::NotificationService::AllSources()); | 46 content::NotificationService::AllSources()); |
46 | 47 |
47 const Extension* extension = LoadExtension( | 48 const Extension* extension = LoadExtension( |
48 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name)); | 49 test_data_dir_.AppendASCII("platform_apps").AppendASCII(name)); |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 bounds); | 185 bounds); |
185 } | 186 } |
186 | 187 |
187 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( | 188 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( |
188 CommandLine* command_line) { | 189 CommandLine* command_line) { |
189 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 190 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
190 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 191 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
191 } | 192 } |
192 | 193 |
193 } // namespace extensions | 194 } // namespace extensions |
OLD | NEW |