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

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

Issue 2336403002: Fix extension content verification out-of-band hash fetching (Closed)
Patch Set: review feedback 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 6906 matching lines...) Expand 10 before | Expand all | Expand 10 after
6917 6917
6918 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED, 6918 service()->Observe(chrome::NOTIFICATION_PROFILE_DESTRUCTION_STARTED,
6919 content::Source<Profile>(profile()), 6919 content::Source<Profile>(profile()),
6920 content::NotificationService::NoDetails()); 6920 content::NotificationService::NoDetails());
6921 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_); 6921 EXPECT_EQ(UnloadedExtensionInfo::REASON_PROFILE_SHUTDOWN, unloaded_reason_);
6922 EXPECT_EQ(0u, registry()->enabled_extensions().size()); 6922 EXPECT_EQ(0u, registry()->enabled_extensions().size());
6923 EXPECT_EQ(0u, registry()->disabled_extensions().size()); 6923 EXPECT_EQ(0u, registry()->disabled_extensions().size());
6924 EXPECT_EQ(0u, registry()->terminated_extensions().size()); 6924 EXPECT_EQ(0u, registry()->terminated_extensions().size());
6925 EXPECT_EQ(0u, registry()->blacklisted_extensions().size()); 6925 EXPECT_EQ(0u, registry()->blacklisted_extensions().size());
6926 } 6926 }
6927
6928 // Test that updating a corrupt extension removes the DISABLE_CORRUPTED disable
6929 // reason.
6930 TEST_F(ExtensionServiceTest, CorruptExtensionUpdate) {
6931 InitializeEmptyExtensionService();
6932
6933 base::FilePath v1_path = data_dir().AppendASCII("good.crx");
6934 const Extension* v1 = InstallCRX(v1_path, INSTALL_NEW);
6935 std::string id = v1->id();
6936
6937 service()->DisableExtension(id, Extension::DISABLE_CORRUPTED);
6938
6939 ExtensionPrefs* prefs = ExtensionPrefs::Get(profile());
6940 EXPECT_TRUE(registry()->disabled_extensions().Contains(id));
6941 EXPECT_TRUE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED));
6942
6943 base::FilePath v2_path = data_dir().AppendASCII("good2.crx");
6944 UpdateExtension(id, v2_path, ENABLED);
6945
6946 EXPECT_FALSE(registry()->disabled_extensions().Contains(id));
6947 EXPECT_FALSE(prefs->HasDisableReason(id, Extension::DISABLE_CORRUPTED));
6948 }
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