Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Side by Side Diff: chrome/browser/apps/ephemeral_app_launcher_browsertest.cc

Issue 547003002: Remove the --event-page-idle-time and --event-page-suspending-time switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 1s Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "chrome/browser/extensions/install_tracker.h" 11 #include "chrome/browser/extensions/install_tracker.h"
12 #include "chrome/browser/extensions/test_blacklist.h" 12 #include "chrome/browser/extensions/test_blacklist.h"
13 #include "chrome/browser/extensions/webstore_installer_test.h" 13 #include "chrome/browser/extensions/webstore_installer_test.h"
14 #include "chrome/browser/ui/browser_finder.h" 14 #include "chrome/browser/ui/browser_finder.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" 15 #include "chrome/browser/ui/tabs/tab_strip_model.h"
16 #include "chrome/common/chrome_switches.h" 16 #include "chrome/common/chrome_switches.h"
17 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
18 #include "content/public/test/test_utils.h" 18 #include "content/public/test/test_utils.h"
19 #include "extensions/browser/extension_prefs.h" 19 #include "extensions/browser/extension_prefs.h"
20 #include "extensions/browser/extension_registry.h" 20 #include "extensions/browser/extension_registry.h"
21 #include "extensions/browser/extension_system.h" 21 #include "extensions/browser/extension_system.h"
22 #include "extensions/browser/extension_util.h" 22 #include "extensions/browser/extension_util.h"
23 #include "extensions/browser/management_policy.h" 23 #include "extensions/browser/management_policy.h"
24 #include "extensions/browser/process_manager.h"
24 #include "extensions/common/switches.h" 25 #include "extensions/common/switches.h"
25 26
26 using extensions::Extension; 27 using extensions::Extension;
27 using extensions::ExtensionPrefs; 28 using extensions::ExtensionPrefs;
28 using extensions::ExtensionRegistry; 29 using extensions::ExtensionRegistry;
29 using extensions::ExtensionSystem; 30 using extensions::ExtensionSystem;
30 using extensions::InstallTracker; 31 using extensions::InstallTracker;
31 namespace webstore_install = extensions::webstore_install; 32 namespace webstore_install = extensions::webstore_install;
32 33
33 namespace { 34 namespace {
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 : WebstoreInstallerTest(kWebstoreDomain, 192 : WebstoreInstallerTest(kWebstoreDomain,
192 kTestDataPath, 193 kTestDataPath,
193 kDefaultAppCrxFilename, 194 kDefaultAppCrxFilename,
194 kAppDomain, 195 kAppDomain,
195 kNonAppDomain) {} 196 kNonAppDomain) {}
196 197
197 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE { 198 virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE {
198 WebstoreInstallerTest::SetUpCommandLine(command_line); 199 WebstoreInstallerTest::SetUpCommandLine(command_line);
199 200
200 // Make event pages get suspended immediately. 201 // Make event pages get suspended immediately.
201 command_line->AppendSwitchASCII(extensions::switches::kEventPageIdleTime, 202 extensions::ProcessManager::SetEventPageIdleTimeForTesting(1);
202 "10"); 203 extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1);
203 command_line->AppendSwitchASCII(
204 extensions::switches::kEventPageSuspendingTime, "10");
205 204
206 // Enable ephemeral apps flag. 205 // Enable ephemeral apps flag.
207 command_line->AppendSwitch(switches::kEnableEphemeralApps); 206 command_line->AppendSwitch(switches::kEnableEphemeralApps);
208 } 207 }
209 208
210 virtual void SetUpOnMainThread() OVERRIDE { 209 virtual void SetUpOnMainThread() OVERRIDE {
211 WebstoreInstallerTest::SetUpOnMainThread(); 210 WebstoreInstallerTest::SetUpOnMainThread();
212 211
213 // Disable ephemeral apps immediately after they stop running in tests. 212 // Disable ephemeral apps immediately after they stop running in tests.
214 EphemeralAppService::Get(profile())->set_disable_delay_for_test(0); 213 EphemeralAppService::Get(profile())->set_disable_delay_for_test(0);
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 } 560 }
562 561
563 // Verifies that a launch will fail if a duplicate launch is in progress. 562 // Verifies that a launch will fail if a duplicate launch is in progress.
564 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) { 563 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) {
565 extensions::ActiveInstallData install_data(kDefaultAppId); 564 extensions::ActiveInstallData install_data(kDefaultAppId);
566 install_data.is_ephemeral = true; 565 install_data.is_ephemeral = true;
567 InstallTracker::Get(profile())->AddActiveInstall(install_data); 566 InstallTracker::Get(profile())->AddActiveInstall(install_data);
568 567
569 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false); 568 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false);
570 } 569 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698