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

Unified Diff: chrome/browser/background/background_application_list_model_unittest.cc

Issue 1497193002: Remove all the ephemeral apps code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tests Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/background/background_application_list_model_unittest.cc
diff --git a/chrome/browser/background/background_application_list_model_unittest.cc b/chrome/browser/background/background_application_list_model_unittest.cc
index 9b873877fc760209774f800ca8288badd1272c9d..35e99e9063a8215ee2ecd5bf8321b233c90d6c58 100644
--- a/chrome/browser/background/background_application_list_model_unittest.cc
+++ b/chrome/browser/background/background_application_list_model_unittest.cc
@@ -132,20 +132,6 @@ void RemoveBackgroundPermission(ExtensionService* service,
.RemovePermissionsUnsafe(
extension, extension->permissions_data()->active_permissions());
}
-
-void AddEphemeralApp(const Extension* extension, ExtensionService* service) {
- extensions::ExtensionPrefs* prefs =
- extensions::ExtensionPrefs::Get(service->profile());
- ASSERT_TRUE(prefs);
- prefs->OnExtensionInstalled(extension,
- extensions::Extension::ENABLED,
- syncer::StringOrdinal(),
- extensions::kInstallFlagIsEphemeral,
- std::string());
-
- service->AddExtension(extension);
-}
-
} // namespace
// Crashes on Mac tryslaves.
@@ -228,32 +214,6 @@ TEST_F(BackgroundApplicationListModelTest, MAYBE_ExplicitTest) {
ASSERT_EQ(0U, model->size());
}
-// Verifies that an ephemeral app cannot trigger background mode.
-TEST_F(BackgroundApplicationListModelTest, EphemeralAppTest) {
- InitializeAndLoadEmptyExtensionService();
- ASSERT_TRUE(service()->is_ready());
- ASSERT_TRUE(registry()->enabled_extensions().is_empty());
- scoped_ptr<BackgroundApplicationListModel> model(
- new BackgroundApplicationListModel(profile_.get()));
- ASSERT_EQ(0U, model->size());
-
- scoped_refptr<Extension> background = CreateExtension("background", true);
-
- // An ephemeral app with the background permission should not trigger
- // background mode.
- AddEphemeralApp(background.get(), service());
- ASSERT_FALSE(IsBackgroundApp(*background.get()));
- ASSERT_EQ(1U, registry()->enabled_extensions().size());
- ASSERT_EQ(0U, model->size());
-
- // If the ephemeral app becomes promoted to an installed app, it can now
- // trigger background mode.
- service()->PromoteEphemeralApp(background.get(), false /*from sync*/);
- ASSERT_TRUE(IsBackgroundApp(*background.get()));
- ASSERT_EQ(1U, registry()->enabled_extensions().size());
- ASSERT_EQ(1U, model->size());
-}
-
// With minimal test logic, verifies behavior with dynamic permissions.
TEST_F(BackgroundApplicationListModelTest, AddRemovePermissionsTest) {
InitializeAndLoadEmptyExtensionService();

Powered by Google App Engine
This is Rietveld 408576698