chromium/chrome/browser/background/background_contents_service_unittest.cc

// Copyright 2012 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/background/background_contents_service.h"

#include <memory>
#include <string>

#include "base/functional/callback.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "build/build_config.h"
#include "chrome/browser/background/background_contents.h"
#include "chrome/browser/background/background_contents_service_factory.h"
#include "chrome/browser/notifications/notification_display_service_tester.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/common/extensions/extension_test_util.h"
#include "chrome/common/pref_names.h"
#include "chrome/test/base/browser_with_test_window_test.h"
#include "chrome/test/base/testing_browser_process.h"
#include "chrome/test/base/testing_profile.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "content/public/test/browser_task_environment.h"
#include "extensions/common/extension.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
#include "ui/message_center/public/cpp/notification.h"
#include "url/gurl.h"

class MockBackgroundContents : public BackgroundContents {};

class BackgroundContentsServiceTest : public testing::Test {};

class BackgroundContentsServiceNotificationTest
    : public BrowserWithTestWindowTest {};

TEST_F(BackgroundContentsServiceTest, Create) {}

TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAdded) {}

TEST_F(BackgroundContentsServiceTest, BackgroundContentsUrlAddedAndClosed) {}

// Test what happens if a BackgroundContents shuts down (say, due to a renderer
// crash) then is restarted. Should not persist URL twice.
TEST_F(BackgroundContentsServiceTest, RestartBackgroundContents) {}

// Ensures that BackgroundContentsService properly tracks the association
// between a BackgroundContents and its parent extension, including
// unregistering the BC when the extension is uninstalled.
TEST_F(BackgroundContentsServiceTest, TestApplicationIDLinkage) {}

TEST_F(BackgroundContentsServiceNotificationTest, TestShowBalloon) {}

TEST_F(BackgroundContentsServiceNotificationTest, TestShowBalloonShutdown) {}

// Verify if a test notification can show the default extension icon for
// a crash notification for an extension without icon.
TEST_F(BackgroundContentsServiceNotificationTest, TestShowBalloonNoIcon) {}

TEST_F(BackgroundContentsServiceNotificationTest, TestShowTwoBalloons) {}