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

Unified Diff: extensions/browser/extension_registry_unittest.cc

Issue 775003002: Misc cleanup in extension_registry_unittest.cc. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_registry_unittest.cc
diff --git a/extensions/browser/extension_registry_unittest.cc b/extensions/browser/extension_registry_unittest.cc
index a23f0ab3106836417b82111414acf4d396e389fe..40cd4fd9b368e234d12ff01a25d2ba41a74a88e2 100644
--- a/extensions/browser/extension_registry_unittest.cc
+++ b/extensions/browser/extension_registry_unittest.cc
@@ -7,7 +7,6 @@
#include <string>
#include "base/memory/ref_counted.h"
-#include "base/strings/string_util.h"
#include "extensions/browser/extension_registry_observer.h"
#include "extensions/browser/uninstall_reason.h"
#include "extensions/common/test_util.h"
@@ -23,18 +22,22 @@ testing::AssertionResult HasSingleExtension(
const scoped_refptr<const Extension>& extension) {
if (list.empty())
return testing::AssertionFailure() << "No extensions in list";
- if (list.size() > 1)
+ if (list.size() > 1) {
return testing::AssertionFailure() << list.size()
<< " extensions, expected 1";
+ }
const Extension* did_load = list[0].get();
- if (did_load != extension.get())
+ if (did_load != extension.get()) {
return testing::AssertionFailure() << "Expected " << extension->id()
<< " found " << did_load->id();
+ }
return testing::AssertionSuccess();
}
class TestObserver : public ExtensionRegistryObserver {
public:
+ TestObserver() {}
+
void Reset() {
loaded_.clear();
unloaded_.clear();
@@ -79,6 +82,8 @@ class TestObserver : public ExtensionRegistryObserver {
ExtensionList unloaded_;
ExtensionList installed_;
ExtensionList uninstalled_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestObserver);
};
TEST_F(ExtensionRegistryTest, FillAndClearRegistry) {
@@ -241,8 +246,8 @@ TEST_F(ExtensionRegistryTest, Observer) {
scoped_refptr<const Extension> extension =
test_util::CreateEmptyExtension("id");
- registry.TriggerOnWillBeInstalled(
- extension.get(), false, false, base::EmptyString());
+ registry.TriggerOnWillBeInstalled(extension.get(), false, false,
+ std::string());
EXPECT_TRUE(HasSingleExtension(observer.installed(), extension.get()));
registry.AddEnabled(extension);
@@ -262,8 +267,7 @@ TEST_F(ExtensionRegistryTest, Observer) {
EXPECT_TRUE(HasSingleExtension(observer.unloaded(), extension.get()));
registry.Shutdown();
- registry.TriggerOnUninstalled(extension.get(),
- extensions::UNINSTALL_REASON_FOR_TESTING);
+ registry.TriggerOnUninstalled(extension.get(), UNINSTALL_REASON_FOR_TESTING);
EXPECT_TRUE(observer.installed().empty());
EXPECT_TRUE(HasSingleExtension(observer.uninstalled(), extension.get()));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698