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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 CHECK(!install_params_.empty()); | 111 CHECK(!install_params_.empty()); |
112 return install_params_.back(); | 112 return install_params_.back(); |
113 } | 113 } |
114 | 114 |
115 private: | 115 private: |
116 virtual void OnExtensionWillBeInstalled( | 116 virtual void OnExtensionWillBeInstalled( |
117 content::BrowserContext* browser_context, | 117 content::BrowserContext* browser_context, |
118 const Extension* extension, | 118 const Extension* extension, |
119 bool is_update, | 119 bool is_update, |
120 bool from_ephemeral, | 120 bool from_ephemeral, |
121 const std::string& old_name) OVERRIDE { | 121 const std::string& old_name) override { |
122 install_params_.push_back( | 122 install_params_.push_back( |
123 InstallParameters(extension->id(), is_update, from_ephemeral)); | 123 InstallParameters(extension->id(), is_update, from_ephemeral)); |
124 } | 124 } |
125 | 125 |
126 std::vector<InstallParameters> install_params_; | 126 std::vector<InstallParameters> install_params_; |
127 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> | 127 ScopedObserver<ExtensionRegistry, ExtensionRegistryObserver> |
128 registry_observer_; | 128 registry_observer_; |
129 }; | 129 }; |
130 | 130 |
131 // Instead of actually changing the system power settings, tests will just | 131 // Instead of actually changing the system power settings, tests will just |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); | 1033 base::Bind(&PowerSaveBlockerStub::Create, &power_settings)); |
1034 | 1034 |
1035 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); | 1035 const Extension* app = InstallAndLaunchEphemeralApp(kPowerTestApp); |
1036 ASSERT_TRUE(app); | 1036 ASSERT_TRUE(app); |
1037 EXPECT_EQ(1, power_settings.keep_awake_count()); | 1037 EXPECT_EQ(1, power_settings.keep_awake_count()); |
1038 | 1038 |
1039 CloseAppWaitForUnload(app->id()); | 1039 CloseAppWaitForUnload(app->id()); |
1040 | 1040 |
1041 EXPECT_EQ(0, power_settings.keep_awake_count()); | 1041 EXPECT_EQ(0, power_settings.keep_awake_count()); |
1042 } | 1042 } |
OLD | NEW |