| 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/shell_window_registry.h" | 8 #include "apps/shell_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/ui/apps/chrome_shell_window_delegate.h" | 14 #include "chrome/browser/ui/apps/chrome_shell_window_delegate.h" |
| 15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 16 #include "chrome/browser/ui/extensions/application_launch.h" | 16 #include "chrome/browser/ui/extensions/application_launch.h" |
| 17 #include "chrome/common/chrome_switches.h" | |
| 18 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
| 19 #include "content/public/test/browser_test_utils.h" | 18 #include "content/public/test/browser_test_utils.h" |
| 20 #include "content/public/test/test_utils.h" | 19 #include "content/public/test/test_utils.h" |
| 21 #include "extensions/common/switches.h" | 20 #include "extensions/common/switches.h" |
| 22 | 21 |
| 23 using apps::ShellWindow; | 22 using apps::ShellWindow; |
| 24 using apps::ShellWindowRegistry; | 23 using apps::ShellWindowRegistry; |
| 25 using content::WebContents; | 24 using content::WebContents; |
| 26 | 25 |
| 27 namespace utils = extension_function_test_utils; | 26 namespace utils = extension_function_test_utils; |
| 28 | 27 |
| 29 namespace extensions { | 28 namespace extensions { |
| 30 | 29 |
| 31 PlatformAppBrowserTest::PlatformAppBrowserTest() { | 30 PlatformAppBrowserTest::PlatformAppBrowserTest() { |
| 32 ChromeShellWindowDelegate::DisableExternalOpenForTesting(); | 31 ChromeShellWindowDelegate::DisableExternalOpenForTesting(); |
| 33 } | 32 } |
| 34 | 33 |
| 35 void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 34 void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
| 36 // Skips ExtensionApiTest::SetUpCommandLine. | 35 // Skips ExtensionApiTest::SetUpCommandLine. |
| 37 ExtensionBrowserTest::SetUpCommandLine(command_line); | 36 ExtensionBrowserTest::SetUpCommandLine(command_line); |
| 38 | 37 |
| 39 // Make event pages get suspended quicker. | 38 // Make event pages get suspended quicker. |
| 40 command_line->AppendSwitchASCII(::switches::kEventPageIdleTime, "1"); | 39 command_line->AppendSwitchASCII(switches::kEventPageIdleTime, "1"); |
| 41 command_line->AppendSwitchASCII(::switches::kEventPageSuspendingTime, "1"); | 40 command_line->AppendSwitchASCII(switches::kEventPageSuspendingTime, "1"); |
| 42 } | 41 } |
| 43 | 42 |
| 44 // static | 43 // static |
| 45 ShellWindow* PlatformAppBrowserTest::GetFirstShellWindowForBrowser( | 44 ShellWindow* PlatformAppBrowserTest::GetFirstShellWindowForBrowser( |
| 46 Browser* browser) { | 45 Browser* browser) { |
| 47 ShellWindowRegistry* app_registry = | 46 ShellWindowRegistry* app_registry = |
| 48 ShellWindowRegistry::Get(browser->profile()); | 47 ShellWindowRegistry::Get(browser->profile()); |
| 49 const ShellWindowRegistry::ShellWindowList& shell_windows = | 48 const ShellWindowRegistry::ShellWindowList& shell_windows = |
| 50 app_registry->shell_windows(); | 49 app_registry->shell_windows(); |
| 51 | 50 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 bounds); | 197 bounds); |
| 199 } | 198 } |
| 200 | 199 |
| 201 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( | 200 void ExperimentalPlatformAppBrowserTest::SetUpCommandLine( |
| 202 CommandLine* command_line) { | 201 CommandLine* command_line) { |
| 203 PlatformAppBrowserTest::SetUpCommandLine(command_line); | 202 PlatformAppBrowserTest::SetUpCommandLine(command_line); |
| 204 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 203 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 205 } | 204 } |
| 206 | 205 |
| 207 } // namespace extensions | 206 } // namespace extensions |
| OLD | NEW |