OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/message_loop/message_loop_proxy.h" | 5 #include "base/message_loop/message_loop_proxy.h" |
6 #include "chrome/browser/apps/ephemeral_app_launcher.h" | 6 #include "chrome/browser/apps/ephemeral_app_launcher.h" |
7 #include "chrome/browser/apps/ephemeral_app_service.h" | 7 #include "chrome/browser/apps/ephemeral_app_service.h" |
8 #include "chrome/browser/extensions/extension_install_checker.h" | 8 #include "chrome/browser/extensions/extension_install_checker.h" |
9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
10 #include "chrome/browser/extensions/extension_test_message_listener.h" | 10 #include "chrome/browser/extensions/extension_test_message_listener.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
191 : WebstoreInstallerTest(kWebstoreDomain, | 191 : WebstoreInstallerTest(kWebstoreDomain, |
192 kTestDataPath, | 192 kTestDataPath, |
193 kDefaultAppCrxFilename, | 193 kDefaultAppCrxFilename, |
194 kAppDomain, | 194 kAppDomain, |
195 kNonAppDomain) {} | 195 kNonAppDomain) {} |
196 | 196 |
197 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { | 197 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { |
198 WebstoreInstallerTest::SetUpCommandLine(command_line); | 198 WebstoreInstallerTest::SetUpCommandLine(command_line); |
199 | 199 |
200 // Make event pages get suspended immediately. | 200 // Make event pages get suspended immediately. |
201 command_line->AppendSwitchASCII(extensions::switches::kEventPageIdleTime, | 201 extensions::ProcessManager::SetEventPageIdleTimeForTesting(1); |
Devlin
2014/09/05 22:06:07
include?
Yoyo Zhou
2014/09/08 16:19:10
Done.
| |
202 "10"); | 202 extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1); |
203 command_line->AppendSwitchASCII( | |
204 extensions::switches::kEventPageSuspendingTime, "10"); | |
205 | 203 |
206 // Enable ephemeral apps flag. | 204 // Enable ephemeral apps flag. |
207 command_line->AppendSwitch(switches::kEnableEphemeralApps); | 205 command_line->AppendSwitch(switches::kEnableEphemeralApps); |
208 } | 206 } |
209 | 207 |
210 virtual void SetUpOnMainThread() OVERRIDE { | 208 virtual void SetUpOnMainThread() OVERRIDE { |
211 WebstoreInstallerTest::SetUpOnMainThread(); | 209 WebstoreInstallerTest::SetUpOnMainThread(); |
212 | 210 |
213 // Disable ephemeral apps immediately after they stop running in tests. | 211 // Disable ephemeral apps immediately after they stop running in tests. |
214 EphemeralAppService::Get(profile())->set_disable_delay_for_test(0); | 212 EphemeralAppService::Get(profile())->set_disable_delay_for_test(0); |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
561 } | 559 } |
562 | 560 |
563 // Verifies that a launch will fail if a duplicate launch is in progress. | 561 // Verifies that a launch will fail if a duplicate launch is in progress. |
564 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) { | 562 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) { |
565 extensions::ActiveInstallData install_data(kDefaultAppId); | 563 extensions::ActiveInstallData install_data(kDefaultAppId); |
566 install_data.is_ephemeral = true; | 564 install_data.is_ephemeral = true; |
567 InstallTracker::Get(profile())->AddActiveInstall(install_data); | 565 InstallTracker::Get(profile())->AddActiveInstall(install_data); |
568 | 566 |
569 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false); | 567 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false); |
570 } | 568 } |
OLD | NEW |