#include "chrome/browser/search/background/wallpaper_search/wallpaper_search_background_manager.h"
#include <vector>
#include "base/files/file_util.h"
#include "base/path_service.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/token.h"
#include "build/build_config.h"
#include "chrome/browser/search/background/ntp_custom_background_service_factory.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/test/base/testing_profile.h"
#include "components/prefs/pref_service.h"
#include "components/sync_preferences/testing_pref_service_syncable.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image.h"
#include "url/gurl.h"
namespace {
const char kWallpaperSearchHistoryId[] = …;
const char kWallpaperSearchHistoryMood[] = …;
const char kWallpaperSearchHistoryStyle[] = …;
const char kWallpaperSearchHistorySubject[] = …;
DoAll;
Return;
SaveArg;
class MockNtpCustomBackgroundService : public NtpCustomBackgroundService { … };
class MockWallpaperSearchBackgroundManagerObserver
: public WallpaperSearchBackgroundManagerObserver { … };
std::unique_ptr<TestingProfile> MakeTestingProfile() { … }
}
class WallpaperSearchBackgroundManagerTest : public testing::Test { … };
TEST_F(WallpaperSearchBackgroundManagerTest, GetHistory) { … }
TEST_F(WallpaperSearchBackgroundManagerTest, SetHistoryImage) { … }
TEST_F(WallpaperSearchBackgroundManagerTest, SetLocalBackgroundImage) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
SetLocalBackgroundImage_Inspiration) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
SetLocalBackgroundImage_DoNotReSetSameImage) { … }
TEST_F(WallpaperSearchBackgroundManagerTest, IsCurrentBackground) { … }
TEST_F(WallpaperSearchBackgroundManagerTest, SaveCurrentBackgroundToHistory) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
SaveCurrentBackgroundToHistory_FullHistory) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
SaveCurrentBackgroundToHistory_AlreadyInHistory) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
SaveCurrentBackgroundToHistory_LastInHistory) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
SaveCurrentBackgroundToHistory_NotCurrentBackground) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
RemoveWallpaperSearchBackground_NotHistory) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
RemoveWallpaperSearchBackground_History) { … }
TEST_F(WallpaperSearchBackgroundManagerTest,
NoCrashIfHistoryContainsIllformedData) { … }
TEST_F(WallpaperSearchBackgroundManagerTest, NotifyAboutHistory) { … }