#include "chrome/browser/new_tab_page/modules/v2/calendar/google_calendar_page_handler.h"
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/json/json_string_value_serializer.h"
#include "base/memory/scoped_refptr.h"
#include "base/test/bind.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/mock_callback.h"
#include "base/values.h"
#include "chrome/browser/new_tab_page/modules/v2/calendar/calendar_data.mojom.h"
#include "chrome/test/base/testing_profile.h"
#include "components/prefs/pref_service.h"
#include "components/search/ntp_features.h"
#include "content/public/test/browser_task_environment.h"
#include "google_apis/common/dummy_auth_service.h"
#include "google_apis/common/request_sender.h"
#include "google_apis/common/test_util.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace {
const char kGoogleCalendarLastDismissedTimePrefName[] = …;
const int32_t kNumEvents = …;
base::Value::List CreateAttachments() { … }
base::Value::List CreateAttendees(int index) { … }
base::Value::Dict CreateConferenceData() { … }
base::Value::Dict CreateEventTime(bool is_all_day_event, bool is_end_time) { … }
base::Value::Dict CreateEvent(int index) { … }
bool CreateEventsJson(std::string* json) { … }
std::unique_ptr<TestingProfile> MakeTestingProfile(
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory) { … }
}
class GoogleCalendarPageHandlerTest : public testing::Test { … };
TEST_F(GoogleCalendarPageHandlerTest, DismissAndRestoreModule) { … }
TEST_F(GoogleCalendarPageHandlerTest, DismissModuleAffectsEvents) { … }
TEST_F(GoogleCalendarPageHandlerTest, GetFakeEvents) { … }
TEST_F(GoogleCalendarPageHandlerTest, GetEvents) { … }
TEST_F(GoogleCalendarPageHandlerTest, GetEventsWithFeatureParams) { … }