#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
namespace {
Pair;
UnorderedElementsAre;
const std::string& GetExpectedOriginName(Profile* profile,
const url::Origin& origin) { … }
}
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
void DeviceSystemTrayIconTestBase::TestSingleProfile(
Profile* profile,
const url::Origin& origin1,
const url::Origin& origin2) { … }
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
class DeviceSystemTrayIconTest : public DeviceSystemTrayIconTestBase { … };
TEST_F(DeviceSystemTrayIconTest, ScheduledRemovalFollowedByImmediateRemoval) { … }
TEST_F(DeviceSystemTrayIconTest, ScheduledRemovalFollowedByStageProfile) { … }
TEST_F(DeviceSystemTrayIconTest, TwoProfilesRemovedFiveSecondsApart) { … }
TEST_F(DeviceSystemTrayIconTest, CallbackAfterDeviceSystemTrayIconDestroyed) { … }