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 "chrome/browser/apps/ephemeral_app_browsertest.h" | 5 #include "chrome/browser/apps/ephemeral_app_browsertest.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "apps/app_restore_service.h" | 9 #include "apps/app_restore_service.h" |
10 #include "apps/saved_files_service.h" | 10 #include "apps/saved_files_service.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 EphemeralAppTestBase::EphemeralAppTestBase() {} | 192 EphemeralAppTestBase::EphemeralAppTestBase() {} |
193 | 193 |
194 EphemeralAppTestBase::~EphemeralAppTestBase() {} | 194 EphemeralAppTestBase::~EphemeralAppTestBase() {} |
195 | 195 |
196 void EphemeralAppTestBase::SetUpCommandLine(base::CommandLine* command_line) { | 196 void EphemeralAppTestBase::SetUpCommandLine(base::CommandLine* command_line) { |
197 // Skip PlatformAppBrowserTest, which sets different values for the switches | 197 // Skip PlatformAppBrowserTest, which sets different values for the switches |
198 // below. | 198 // below. |
199 ExtensionBrowserTest::SetUpCommandLine(command_line); | 199 ExtensionBrowserTest::SetUpCommandLine(command_line); |
200 | 200 |
201 // Make event pages get suspended immediately. | 201 // Make event pages get suspended immediately. |
202 command_line->AppendSwitchASCII( | 202 extensions::ProcessManager::SetEventPageIdleTimeForTesting(1); |
203 extensions::switches::kEventPageIdleTime, "10"); | 203 extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1); |
204 command_line->AppendSwitchASCII( | |
205 extensions::switches::kEventPageSuspendingTime, "10"); | |
206 | 204 |
207 // Enable ephemeral apps flag. | 205 // Enable ephemeral apps flag. |
208 command_line->AppendSwitch(switches::kEnableEphemeralApps); | 206 command_line->AppendSwitch(switches::kEnableEphemeralApps); |
209 } | 207 } |
210 | 208 |
211 void EphemeralAppTestBase::SetUpOnMainThread() { | 209 void EphemeralAppTestBase::SetUpOnMainThread() { |
212 PlatformAppBrowserTest::SetUpOnMainThread(); | 210 PlatformAppBrowserTest::SetUpOnMainThread(); |
213 | 211 |
214 // Disable ephemeral apps immediately after they stop running in tests. | 212 // Disable ephemeral apps immediately after they stop running in tests. |
215 EphemeralAppService::Get(profile())->set_disable_delay_for_test(0); | 213 EphemeralAppService::Get(profile())->set_disable_delay_for_test(0); |
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1035 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); | 1033 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); |
1036 | 1034 |
1037 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); | 1035 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); |
1038 ASSERT_TRUE(app); | 1036 ASSERT_TRUE(app); |
1039 EXPECT_EQ(1, power_settings.keep_awake_count()); | 1037 EXPECT_EQ(1, power_settings.keep_awake_count()); |
1040 | 1038 |
1041 CloseAppWaitForUnload(app->id()); | 1039 CloseAppWaitForUnload(app->id()); |
1042 | 1040 |
1043 EXPECT_EQ(0, power_settings.keep_awake_count()); | 1041 EXPECT_EQ(0, power_settings.keep_awake_count()); |
1044 } | 1042 } |
OLD | NEW |