#include "chrome/browser/web_applications/web_contents/web_app_data_retriever.h"
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/functional/bind.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/bind.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_helpers.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/browser/web_applications/web_app_install_utils.h"
#include "chrome/test/base/chrome_render_view_host_test_harness.h"
#include "chrome/test/base/testing_profile.h"
#include "components/webapps/browser/installable/fake_installable_manager.h"
#include "components/webapps/browser/installable/installable_data.h"
#include "components/webapps/browser/installable/installable_logging.h"
#include "components/webapps/browser/installable/installable_manager.h"
#include "components/webapps/browser/installable/installable_metrics.h"
#include "components/webapps/common/web_app_id.h"
#include "components/webapps/common/web_page_metadata.mojom.h"
#include "components/webapps/common/web_page_metadata_agent.mojom-test-utils.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/site_instance.h"
#include "content/public/test/browser_task_environment.h"
#include "content/public/test/test_utils.h"
#include "content/public/test/web_contents_tester.h"
#include "mojo/public/cpp/bindings/associated_receiver.h"
#include "mojo/public/cpp/bindings/pending_associated_receiver.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/mojom/manifest/manifest.mojom.h"
namespace web_app {
namespace {
const char16_t kFooTitle[] = …;
}
class FakeWebPageMetadataAgent
: public webapps::mojom::WebPageMetadataAgentInterceptorForTesting { … };
class WebAppDataRetrieverTest : public ChromeRenderViewHostTestHarness { … };
TEST_F(WebAppDataRetrieverTest, GetWebAppInstallInfo_NoEntry) { … }
TEST_F(WebAppDataRetrieverTest, GetWebAppInstallInfo_AppUrlAbsent) { … }
TEST_F(WebAppDataRetrieverTest, GetWebAppInstallInfo_AppUrlPresent) { … }
TEST_F(WebAppDataRetrieverTest, GetWebAppInstallInfo_TitleAbsentFromRenderer) { … }
TEST_F(WebAppDataRetrieverTest,
GetWebAppInstallInfo_TitleAbsentFromWebContents) { … }
TEST_F(WebAppDataRetrieverTest, GetWebAppInstallInfo_ConnectionError) { … }
TEST_F(WebAppDataRetrieverTest, GetWebAppInstallInfo_WebContentsDestroyed) { … }
TEST_F(WebAppDataRetrieverTest,
CheckInstallabilityAndRetrieveManifest_WebContentsDestroyed) { … }
TEST_F(WebAppDataRetrieverTest, GetIcons_WebContentsDestroyed) { … }
TEST_F(WebAppDataRetrieverTest, GetWebAppInstallInfo_FrameNavigated) { … }
TEST_F(WebAppDataRetrieverTest, CheckInstallabilityAndRetrieveManifest) { … }
TEST_F(WebAppDataRetrieverTest, CheckInstallabilityFails) { … }
}