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