#include <string>
-#include "base/file_util.h"
+#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/prefs/pref_registry_simple.h"
#include "chrome/browser/extensions/test_extension_service.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/extensions/background_info.h"
-#include "chrome/common/extensions/extension.h"
-#include "chrome/common/extensions/extension_set.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/testing_pref_service_syncable.h"
-#include "components/user_prefs/pref_registry_syncable.h"
+#include "chrome/test/base/testing_profile.h"
+#include "components/pref_registry/pref_registry_syncable.h"
+#include "content/public/test/test_browser_thread_bundle.h"
#include "extensions/common/constants.h"
+#include "extensions/common/extension.h"
+#include "extensions/common/extension_set.h"
+#include "extensions/common/manifest_handlers/background_info.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace extensions {
MockExtensionService() : ready_(false), unloaded_count_(0) {
}
- virtual void AddComponentExtension(const Extension* extension) OVERRIDE {
+ void AddComponentExtension(const Extension* extension) override {
EXPECT_FALSE(extension_set_.Contains(extension->id()));
// ExtensionService must become the owner of the extension object.
extension_set_.Insert(extension);
}
- virtual void UnloadExtension(
- const std::string& extension_id,
- UnloadedExtensionInfo::Reason reason) OVERRIDE {
+ void UnloadExtension(const std::string& extension_id,
+ UnloadedExtensionInfo::Reason reason) override {
ASSERT_TRUE(extension_set_.Contains(extension_id));
// Remove the extension with the matching id.
extension_set_.Remove(extension_id);
unloaded_count_++;
}
- virtual void RemoveComponentExtension(const std::string & extension_id)
- OVERRIDE {
+ void RemoveComponentExtension(const std::string& extension_id) override {
UnloadExtension(extension_id, UnloadedExtensionInfo::REASON_DISABLE);
}
- virtual bool is_ready() OVERRIDE {
- return ready_;
- }
+ bool is_ready() override { return ready_; }
- virtual const ExtensionSet* extensions() const OVERRIDE {
- return &extension_set_;
- }
+ const ExtensionSet* extensions() const override { return &extension_set_; }
void set_ready(bool ready) {
ready_ = ready;
ComponentLoaderTest()
// Note: we pass the same pref service here, to stand in for both
// user prefs and local state.
- : component_loader_(&extension_service_, &prefs_, &local_state_) {
+ : component_loader_(&extension_service_,
+ &prefs_,
+ &local_state_,
+ &profile_) {
}
- virtual void SetUp() OVERRIDE {
+ void SetUp() override {
extension_path_ =
GetBasePath().AppendASCII("good")
.AppendASCII("Extensions")
// Register the local state prefs.
#if defined(OS_CHROMEOS)
local_state_.registry()->RegisterBooleanPref(
- prefs::kSpokenFeedbackEnabled, false);
+ prefs::kAccessibilitySpokenFeedbackEnabled, false);
#endif
}
MockExtensionService extension_service_;
TestingPrefServiceSyncable prefs_;
TestingPrefServiceSimple local_state_;
+ TestingProfile profile_;
ComponentLoader component_loader_;
// The root directory of the text extension.
// The contents of the text extension's manifest file.
std::string manifest_contents_;
+ content::TestBrowserThreadBundle thread_bundle_;
+
base::FilePath GetBasePath() {
base::FilePath test_data_dir;
PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir);
};
TEST_F(ComponentLoaderTest, ParseManifest) {
- scoped_ptr<DictionaryValue> manifest;
+ scoped_ptr<base::DictionaryValue> manifest;
// Test invalid JSON.
manifest.reset(