chromium/chrome/browser/extensions/external_install_error_browsertest.cc

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

#include "chrome/browser/extensions/external_install_error.h"

#include <memory>

#include "base/test/scoped_feature_list.h"
#include "chrome/browser/extensions/extension_browsertest.h"
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/external_install_manager.h"
#include "chrome/browser/extensions/webstore_data_fetcher.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/global_error/global_error_waiter.h"
#include "content/public/test/browser_test.h"
#include "content/public/test/test_utils.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/mock_external_provider.h"
#include "extensions/browser/test_extension_registry_observer.h"
#include "extensions/common/extension_features.h"

namespace extensions {

namespace {

constexpr char kMockUserCountString[] =;
constexpr char kMockRatingCountString[] =;
constexpr int kMockRatingCount =;
constexpr double kMockAverageRating =;

std::unique_ptr<FetchItemSnippetResponse> CreateMockResponse(
    const ExtensionId& id) {}

}  // namespace

class ExternalInstallErrorTest : public ExtensionBrowserTest {};

// Test that global errors don't crash on shutdown. See crbug.com/720081.
// TODO(crbug.com/325314721): Remove this test once we stop using the old item
// JSON API to fetch webstore data.
IN_PROC_BROWSER_TEST_F(ExternalInstallErrorTest, TestShutdown) {}

class ExternalInstallErrorItemSnippetsTest : public ExternalInstallErrorTest {};

// Similar to the ExternalInstallErrorTest version of this test except
// webstore data is fetched from the item snippets API (API response is mocked)
// for this test.
IN_PROC_BROWSER_TEST_F(ExternalInstallErrorItemSnippetsTest,
                       TestShutdownWithWebstoreExtension) {}

// Same as the above test except the extension does not update from the
// webstore, so the prompt should not display any webstore data.
IN_PROC_BROWSER_TEST_F(ExternalInstallErrorItemSnippetsTest,
                       TestShutdownWithNonWebstoreExtension) {}

}  // namespace extensions