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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/stringprintf.h" | 8 #include "base/stringprintf.h" |
9 #include "chrome/browser/extensions/api/tabs/tabs.h" | 9 #include "chrome/browser/extensions/api/tabs/tabs.h" |
10 #include "chrome/browser/extensions/extension_function_test_utils.h" | 10 #include "chrome/browser/extensions/extension_function_test_utils.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 PlatformAppBrowserTest::PlatformAppBrowserTest() { | 57 PlatformAppBrowserTest::PlatformAppBrowserTest() { |
58 } | 58 } |
59 | 59 |
60 PlatformAppBrowserTest::~PlatformAppBrowserTest() { | 60 PlatformAppBrowserTest::~PlatformAppBrowserTest() { |
61 } | 61 } |
62 | 62 |
63 void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) { | 63 void PlatformAppBrowserTest::SetUpCommandLine(CommandLine* command_line) { |
64 ExtensionBrowserTest::SetUpCommandLine(command_line); | 64 ExtensionBrowserTest::SetUpCommandLine(command_line); |
65 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 65 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
| 66 |
| 67 // Make event pages get suspended quicker. |
| 68 command_line->AppendSwitchASCII(switches::kEventPageIdleTime, "1"); |
| 69 command_line->AppendSwitchASCII(switches::kEventPageUnloadingTime, "1"); |
66 } | 70 } |
67 | 71 |
68 void PlatformAppBrowserTest::SetUpOnMainThread() { | 72 void PlatformAppBrowserTest::SetUpOnMainThread() { |
69 mock_external_url_controller_.reset(new MockExternalUrlController()); | 73 mock_external_url_controller_.reset(new MockExternalUrlController()); |
70 ShellWindow::SetExternalUrlControllerForTesting( | 74 ShellWindow::SetExternalUrlControllerForTesting( |
71 mock_external_url_controller_.get()); | 75 mock_external_url_controller_.get()); |
72 } | 76 } |
73 | 77 |
74 const Extension* PlatformAppBrowserTest::LoadAndLaunchPlatformApp( | 78 const Extension* PlatformAppBrowserTest::LoadAndLaunchPlatformApp( |
75 const char* name) { | 79 const char* name) { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 189 |
186 void PlatformAppBrowserTest::CloseShellWindow(ShellWindow* window) { | 190 void PlatformAppBrowserTest::CloseShellWindow(ShellWindow* window) { |
187 content::WindowedNotificationObserver destroyed_observer( | 191 content::WindowedNotificationObserver destroyed_observer( |
188 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, | 192 content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
189 content::NotificationService::AllSources()); | 193 content::NotificationService::AllSources()); |
190 window->GetBaseWindow()->Close(); | 194 window->GetBaseWindow()->Close(); |
191 destroyed_observer.Wait(); | 195 destroyed_observer.Wait(); |
192 } | 196 } |
193 | 197 |
194 } // namespace extensions | 198 } // namespace extensions |
OLD | NEW |