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 49253005: Fetch extension blacklist states from SafeBrowsing server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
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_unittest.h" 5 #include "chrome/browser/extensions/extension_service_unittest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 6652 matching lines...) Expand 10 before | Expand all | Expand 10 after
6663 id_set.insert(id); 6663 id_set.insert(id);
6664 extensions::ExtensionNotificationObserver notifications( 6664 extensions::ExtensionNotificationObserver notifications(
6665 content::NotificationService::AllSources(), id_set); 6665 content::NotificationService::AllSources(), id_set);
6666 6666
6667 // Installation should be allowed but the extension should never have been 6667 // Installation should be allowed but the extension should never have been
6668 // loaded and it should be blacklisted in prefs. 6668 // loaded and it should be blacklisted in prefs.
6669 service_->OnExtensionInstalled( 6669 service_->OnExtensionInstalled(
6670 extension.get(), 6670 extension.get(),
6671 syncer::StringOrdinal(), 6671 syncer::StringOrdinal(),
6672 false /* has requirement errors */, 6672 false /* has requirement errors */,
6673 extensions::Blacklist::BLACKLISTED_MALWARE, 6673 extensions::BLACKLISTED_MALWARE,
6674 false /* wait for idle */); 6674 false /* wait for idle */);
6675 base::RunLoop().RunUntilIdle(); 6675 base::RunLoop().RunUntilIdle();
6676 6676
6677 // Extension was installed but not loaded. 6677 // Extension was installed but not loaded.
6678 EXPECT_TRUE(notifications.CheckNotifications( 6678 EXPECT_TRUE(notifications.CheckNotifications(
6679 chrome::NOTIFICATION_EXTENSION_INSTALLED)); 6679 chrome::NOTIFICATION_EXTENSION_INSTALLED));
6680 6680
6681 EXPECT_TRUE(service_->GetInstalledExtension(id)); 6681 EXPECT_TRUE(service_->GetInstalledExtension(id));
6682 EXPECT_FALSE(service_->extensions()->Contains(id)); 6682 EXPECT_FALSE(service_->extensions()->Contains(id));
6683 EXPECT_TRUE(service_->blacklisted_extensions()->Contains(id)); 6683 EXPECT_TRUE(service_->blacklisted_extensions()->Contains(id));
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
6741 // ReconcileKnownDisabled(). 6741 // ReconcileKnownDisabled().
6742 service_->EnableExtension(good2); 6742 service_->EnableExtension(good2);
6743 service_->ReconcileKnownDisabled(); 6743 service_->ReconcileKnownDisabled();
6744 expected_extensions.insert(good2); 6744 expected_extensions.insert(good2);
6745 expected_disabled_extensions.erase(good2); 6745 expected_disabled_extensions.erase(good2);
6746 6746
6747 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); 6747 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs());
6748 EXPECT_EQ(expected_disabled_extensions, 6748 EXPECT_EQ(expected_disabled_extensions,
6749 service_->disabled_extensions()->GetIDs()); 6749 service_->disabled_extensions()->GetIDs());
6750 } 6750 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/extensions/fake_safe_browsing_database_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698