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

Unified Diff: chrome/browser/ui/app_list/test/fake_profile_store.h

Issue 24707002: Add unit tests for AppListServiceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: un-const an iterator Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/test/fake_profile_store.h
diff --git a/chrome/browser/ui/app_list/test/fake_profile_store.h b/chrome/browser/ui/app_list/test/fake_profile_store.h
new file mode 100644
index 0000000000000000000000000000000000000000..b1dc8634c31befbd516cf9e2b3ffcc1f5a4fa304
--- /dev/null
+++ b/chrome/browser/ui/app_list/test/fake_profile_store.h
@@ -0,0 +1,41 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_
+#define CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_
+
+#include <map>
+
+#include "base/callback.h"
+#include "base/observer_list.h"
+#include "chrome/browser/ui/app_list/profile_store.h"
+
+class FakeProfileStore : public ProfileStore {
+ public:
+ explicit FakeProfileStore(const base::FilePath& user_data_dir);
+ virtual ~FakeProfileStore();
+
+ void LoadProfile(Profile* profile);
+ void RemoveProfile(Profile* profile);
+
+ // ProfileStore overrides.
+ virtual void AddProfileObserver(ProfileInfoCacheObserver* observer) OVERRIDE;
+ virtual void LoadProfileAsync(
+ const base::FilePath& path,
+ base::Callback<void(Profile*)> callback) OVERRIDE;
+ virtual Profile* GetProfileByPath(const base::FilePath& path) OVERRIDE;
+ virtual base::FilePath GetUserDataDir() OVERRIDE;
+ virtual bool IsProfileManaged(const base::FilePath& path) OVERRIDE;
+
+ private:
+ base::FilePath user_data_dir_;
+ typedef std::map<base::FilePath, base::Callback<void(Profile*)> >
+ CallbacksByPath;
+ CallbacksByPath callbacks_;
+ ObserverList<ProfileInfoCacheObserver> observer_list_;
+ typedef std::map<base::FilePath, Profile*> ProfilesByPath;
+ ProfilesByPath loaded_profiles_;
+};
+
+#endif // CHROME_BROWSER_UI_APP_LIST_TEST_FAKE_PROFILE_STORE_H_
« no previous file with comments | « chrome/browser/ui/app_list/test/fake_profile.cc ('k') | chrome/browser/ui/app_list/test/fake_profile_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698