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

Side by Side Diff: chrome/browser/extensions/extension_service_unittest.cc

Issue 2350403002: Fix extension content verification out-of-band hash fetching (Closed)
Patch Set: Created 4 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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 6901 matching lines...) Expand 10 before | Expand all | Expand 10 after
6912 6912
6913 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, 6913 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED,
6914 content::Source<Profile>(profile()), 6914 content::Source<Profile>(profile()),
6915 content::NotificationService::NoDetails()); 6915 content::NotificationService::NoDetails());
6916 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); 6916 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_);
6917 EXPECT_EQ(0u, registry()->enabled_extensions().size()); 6917 EXPECT_EQ(0u, registry()->enabled_extensions().size());
6918 EXPECT_EQ(0u, registry()->disabled_extensions().size()); 6918 EXPECT_EQ(0u, registry()->disabled_extensions().size());
6919 EXPECT_EQ(0u, registry()->terminated_extensions().size()); 6919 EXPECT_EQ(0u, registry()->terminated_extensions().size());
6920 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); 6920 EXPECT_EQ(0u, registry()->blacklisted_extensions().size());
6921 } 6921 }
6922
6923 // Test that updating a corrupt extension removes the DISABLE_CORRUPTED disable
6924 // reason.
6925 TEST_F(ExtensionServiceTest, CorruptExtensionUpdate) {
6926 InitializeEmptyExtensionService();
6927
6928 base::FilePath v1_path = data_dir().AppendASCII("good.crx");
6929 const Extension* v1 = InstallCRX(v1_path, INSTALL_NEW);
6930 std::string id = v1->id();
6931
6932 service()->DisableExtension(id, Extension::DISABLE_CORRUPTED);
6933
6934 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile());
6935 EXPECT_TRUE(registry()->disabled_extensions().Contains(id));
6936 EXPECT_TRUE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED));
6937
6938 base::FilePath v2_path = data_dir().AppendASCII("good2.crx");
6939 UpdateExtension(id, v2_path, ENABLED);
6940
6941 EXPECT_FALSE(registry()->disabled_extensions().Contains(id));
6942 EXPECT_FALSE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED));
6943 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/common/extensions/extension_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698