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

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 6667 matching lines...) Expand 10 before | Expand all | Expand 10 after
6678 id_set.insert(id); 6678 id_set.insert(id);
6679 extensions::ExtensionNotificationObserver notifications( 6679 extensions::ExtensionNotificationObserver notifications(
6680 content::NotificationService::AllSources(), id_set); 6680 content::NotificationService::AllSources(), id_set);
6681 6681
6682 // Installation should be allowed but the extension should never have been 6682 // Installation should be allowed but the extension should never have been
6683 // loaded and it should be blacklisted in prefs. 6683 // loaded and it should be blacklisted in prefs.
6684 service_->OnExtensionInstalled( 6684 service_->OnExtensionInstalled(
6685 extension.get(), 6685 extension.get(),
6686 syncer::StringOrdinal(), 6686 syncer::StringOrdinal(),
6687 false /* has requirement errors */, 6687 false /* has requirement errors */,
6688 extensions::Blacklist::BLACKLISTED_MALWARE, 6688 extensions::BLACKLISTED_MALWARE,
6689 false /* wait for idle */); 6689 false /* wait for idle */);
6690 base::RunLoop().RunUntilIdle(); 6690 base::RunLoop().RunUntilIdle();
6691 6691
6692 // Extension was installed but not loaded. 6692 // Extension was installed but not loaded.
6693 EXPECT_TRUE(notifications.CheckNotifications( 6693 EXPECT_TRUE(notifications.CheckNotifications(
6694 chrome::NOTIFICATION_EXTENSION_INSTALLED)); 6694 chrome::NOTIFICATION_EXTENSION_INSTALLED));
6695 6695
6696 EXPECT_TRUE(service_->GetInstalledExtension(id)); 6696 EXPECT_TRUE(service_->GetInstalledExtension(id));
6697 EXPECT_FALSE(service_->extensions()->Contains(id)); 6697 EXPECT_FALSE(service_->extensions()->Contains(id));
6698 EXPECT_TRUE(service_->blacklisted_extensions()->Contains(id)); 6698 EXPECT_TRUE(service_->blacklisted_extensions()->Contains(id));
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
6758 service_->ReconcileKnownDisabled(); 6758 service_->ReconcileKnownDisabled();
6759 expected_extensions.insert(good2); 6759 expected_extensions.insert(good2);
6760 expected_disabled_extensions.erase(good2); 6760 expected_disabled_extensions.erase(good2);
6761 6761
6762 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs()); 6762 EXPECT_EQ(expected_extensions, service_->extensions()->GetIDs());
6763 EXPECT_EQ(expected_disabled_extensions, 6763 EXPECT_EQ(expected_disabled_extensions,
6764 service_->disabled_extensions()->GetIDs()); 6764 service_->disabled_extensions()->GetIDs());
6765 } 6765 }
6766 6766
6767 #endif // #if !(defined(OS_LINUX) && defined(USE_AURA) && !defined(OS_CHROMEOS)) 6767 #endif // #if !(defined(OS_LINUX) && defined(USE_AURA) && !defined(OS_CHROMEOS))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698