chromium/chrome/browser/ui/lens/lens_overlay_query_controller_unittest.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "lens_overlay_query_controller.h"

#include "base/base64url.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/lens/core/mojom/overlay_object.mojom.h"
#include "chrome/browser/lens/core/mojom/text.mojom.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/test/base/testing_profile.h"
#include "components/endpoint_fetcher/endpoint_fetcher.h"
#include "components/lens/lens_features.h"
#include "content/public/test/browser_task_environment.h"
#include "google_apis/common/api_error_codes.h"
#include "net/base/url_util.h"
#include "net/http/http_status_code.h"
#include "net/traffic_annotation/network_traffic_annotation.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/icu/source/common/unicode/locid.h"
#include "third_party/icu/source/common/unicode/unistr.h"
#include "third_party/icu/source/i18n/unicode/timezone.h"
#include "third_party/lens_server_proto/lens_overlay_request_id.pb.h"
#include "third_party/lens_server_proto/lens_overlay_server.pb.h"
#include "third_party/lens_server_proto/lens_overlay_visual_search_interaction_data.pb.h"
#include "ui/gfx/codec/jpeg_codec.h"
#include "url/gurl.h"

namespace lens {

// The fake multimodal query text.
constexpr char kTestQueryText[] =;

// The fake suggest signals.
constexpr char kTestSuggestSignals[] =;

// The fake server session id.
constexpr char kTestServerSessionId[] =;

// The fake api key to use for fetching requests.
constexpr char kTestApiKey[] =;

// The locale to use.
constexpr char kLocale[] =;

// The fake page information.
constexpr char kTestPageUrl[] =;
constexpr char kTestPageTitle[] =;

// The url parameter key for the search context.
constexpr char kSearchContextParamKey[] =;

// The timestamp param.
constexpr char kStartTimeQueryParam[] =;

// The visual search interaction log data param.
constexpr char kVisualSearchInteractionDataQueryParameterKey[] =;

// Query parameter for the request id.
inline constexpr char kRequestIdParameterKey[] =;

// The encoded search context for the test page and title.
constexpr char kTestEncodedSearchContext[] =;

// The region.
constexpr char kRegion[] =;

// The time zone.
constexpr char kTimeZone[] =;

// The parameter key for gen204 request.
constexpr char kGen204IdentifierQueryParameter[] =;

class FakeEndpointFetcher : public EndpointFetcher {};

class LensOverlayQueryControllerMock : public LensOverlayQueryController {};

class LensOverlayQueryControllerTest : public testing::Test {};

TEST_F(LensOverlayQueryControllerTest, FetchInitialQuery_ReturnsResponse) {}

TEST_F(LensOverlayQueryControllerTest,
       FetchRegionSearchInteraction_ReturnsResponses) {}

TEST_F(LensOverlayQueryControllerTest,
       FetchRegionSearchInteractionWithBytes_ReturnsResponse) {}

TEST_F(LensOverlayQueryControllerTest,
       FetchMultimodalSearchInteraction_ReturnsResponses) {}

TEST_F(LensOverlayQueryControllerTest,
       FetchTextOnlyInteraction_ReturnsResponse) {}

TEST_F(LensOverlayQueryControllerTest,
       FetchInteraction_StartsNewQueryFlowAfterTimeout) {}

TEST_F(LensOverlayQueryControllerTest,
       FetchInteraction_UsesSameAnalyticsIdForLensRequestAndUrl) {}

}  // namespace lens