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

Unified Diff: chrome/browser/profiles/profile_info_cache_unittest.h

Issue 8894005: Ensure that use of GAIA names are considered when handling desktop shortcut changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: beefed comment Created 9 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
Index: chrome/browser/profiles/profile_info_cache_unittest.h
===================================================================
--- chrome/browser/profiles/profile_info_cache_unittest.h (revision 114091)
+++ chrome/browser/profiles/profile_info_cache_unittest.h (working copy)
@@ -6,7 +6,10 @@
#define CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_UNITTEST_H_
#pragma once
+#include <set>
+
#include "base/message_loop.h"
+#include "chrome/browser/profiles/profile_info_cache_observer.h"
#include "chrome/test/base/testing_profile_manager.h"
#include "content/test/test_browser_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -14,6 +17,35 @@
class FilePath;
class ProfileInfoCache;
+// Class used to test that ProfileInfoCache does not try to access any
+// unexpected profile names.
+class ProfileNameVerifierObserver : public ProfileInfoCacheObserver {
+ public:
+ ProfileNameVerifierObserver();
+ virtual ~ProfileNameVerifierObserver();
+
+ // ProfileInfoCacheObserver overrides:
+ virtual void OnProfileAdded(
+ const string16& profile_name,
+ const string16& profile_base_dir,
+ const FilePath& profile_path,
+ const gfx::Image* avatar_image) OVERRIDE;
+ virtual void OnProfileRemoved(
+ const string16& profile_name) OVERRIDE;
+ virtual void OnProfileNameChanged(
+ const string16& old_profile_name,
+ const string16& new_profile_name) OVERRIDE;
+ virtual void OnProfileAvatarChanged(
+ const string16& profile_name,
+ const string16& profile_base_dir,
+ const FilePath& profile_path,
+ const gfx::Image* avatar_image) OVERRIDE;
+
+ private:
+ std::set<string16> profile_names_;
+ DISALLOW_COPY_AND_ASSIGN(ProfileNameVerifierObserver);
+};
+
class ProfileInfoCacheTest : public testing::Test {
protected:
ProfileInfoCacheTest();
@@ -33,6 +65,7 @@
MessageLoopForUI ui_loop_;
content::TestBrowserThread ui_thread_;
content::TestBrowserThread file_thread_;
+ ProfileNameVerifierObserver name_observer_;
};
#endif // CHROME_BROWSER_PROFILES_PROFILE_INFO_CACHE_UNITTEST_H_
« no previous file with comments | « chrome/browser/profiles/profile_info_cache.cc ('k') | chrome/browser/profiles/profile_info_cache_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698