chromium/chrome/browser/device_notifications/device_system_tray_icon_unittest.cc

// Copyright 2023 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/device_notifications/device_system_tray_icon_unittest.h"

#include <memory>
#include <string>
#include <vector>

#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/device_notifications/device_system_tray_icon.h"
#include "chrome/grit/branded_strings.h"
#include "chrome/grit/generated_resources.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_manager.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
#include "url/origin.h"

#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "base/command_line.h"
#include "base/values.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/test_extension_system.h"
#include "extensions/common/extension.h"
#include "extensions/common/extension_builder.h"
#endif  // BUILDFLAG(ENABLE_EXTENSIONS)

namespace {

Pair;
UnorderedElementsAre;

const std::string& GetExpectedOriginName(Profile* profile,
                                         const url::Origin& origin) {}

}  // namespace

void DeviceSystemTrayIconTestBase::TearDown() {}

Profile* DeviceSystemTrayIconTestBase::CreateTestingProfile(
    const std::string& profile_name) {}

#if BUILDFLAG(ENABLE_EXTENSIONS)
scoped_refptr<const extensions::Extension>
DeviceSystemTrayIconTestBase::CreateExtensionWithName(
    const std::string& extension_name) {}

void DeviceSystemTrayIconTestBase::AddExtensionToProfile(
    Profile* profile,
    const extensions::Extension* extension) {}

void DeviceSystemTrayIconTestBase::UnloadExtensionFromProfile(
    Profile* profile,
    const extensions::Extension* extension) {}
#endif  // BUILDFLAG(ENABLE_EXTENSIONS)

void DeviceSystemTrayIconTestBase::TestSingleProfile(
    Profile* profile,
    const url::Origin& origin1,
    const url::Origin& origin2) {}

// Simulate a device connection bounce with a duration of 1 microsecond and
// ensure the profile lingers for 10 seconds.
void DeviceSystemTrayIconTestBase::TestBounceConnection(
    Profile* profile,
    const url::Origin& origin) {}

void DeviceSystemTrayIconTestBase::TestMultipleProfiles(
    const std::vector<
        std::pair<Profile*, std::vector<std::pair<url::Origin, std::string>>>>&
        profile_origins_pairs) {}

#if BUILDFLAG(ENABLE_EXTENSIONS)
void DeviceSystemTrayIconTestBase::TestSingleProfileExtentionOrigins() {}

void DeviceSystemTrayIconTestBase::TestBounceConnectionExtensionOrigins() {}

void DeviceSystemTrayIconTestBase::TestMultipleProfilesExtensionOrigins() {}

void DeviceSystemTrayIconTestBase::TestExtensionRemoval() {}
#endif  // BUILDFLAG(ENABLE_EXTENSIONS)

class DeviceSystemTrayIconTest : public DeviceSystemTrayIconTestBase {};

// A profile is scheduled to be removed followed by an immediate removal
// request.
TEST_F(DeviceSystemTrayIconTest, ScheduledRemovalFollowedByImmediateRemoval) {}

// A profile is scheduled to be removed then stage profile request comes in.
TEST_F(DeviceSystemTrayIconTest, ScheduledRemovalFollowedByStageProfile) {}

// Two profiles removed 5 seconds apart.
TEST_F(DeviceSystemTrayIconTest, TwoProfilesRemovedFiveSecondsApart) {}

// This test case just to make sure it can run through the scenario without
// causing any unexpected crash.
TEST_F(DeviceSystemTrayIconTest, CallbackAfterDeviceSystemTrayIconDestroyed) {}