#include "chrome/browser/extensions/api/tab_groups/tab_groups_api.h"
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/containers/contains.h"
#include "base/memory/raw_ptr.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/values.h"
#include "chrome/browser/extensions/api/tab_groups/tab_groups_constants.h"
#include "chrome/browser/extensions/api/tab_groups/tab_groups_event_router.h"
#include "chrome/browser/extensions/api/tab_groups/tab_groups_event_router_factory.h"
#include "chrome/browser/extensions/api/tab_groups/tab_groups_util.h"
#include "chrome/browser/extensions/api/tabs/tabs_constants.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/extensions/extension_tab_util.h"
#include "chrome/browser/sessions/session_tab_helper_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_keyed_service.h"
#include "chrome/browser/ui/tabs/saved_tab_groups/saved_tab_group_service_factory.h"
#include "chrome/browser/ui/tabs/tab_group.h"
#include "chrome/browser/ui/tabs/tab_group_model.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/test/base/test_browser_window.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/sessions/content/session_tab_helper.h"
#include "components/tab_groups/tab_group_color.h"
#include "components/tab_groups/tab_group_id.h"
#include "components/tab_groups/tab_group_visual_data.h"
#include "content/public/browser/browser_context.h"
#include "content/public/test/web_contents_tester.h"
#include "extensions/browser/api_test_utils.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/event_router_factory.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/test_event_router_observer.h"
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension_builder.h"
namespace extensions {
namespace {
base::Value::List RunTabGroupsQueryFunction(
content::BrowserContext* browser_context,
const Extension* extension,
const std::string& query_info) { … }
base::Value::Dict RunTabGroupsGetFunction(
content::BrowserContext* browser_context,
const Extension* extension,
const std::string& args) { … }
scoped_refptr<const Extension> CreateTabGroupsExtension() { … }
std::unique_ptr<KeyedService> BuildTabGroupsEventRouter(
content::BrowserContext* context) { … }
std::unique_ptr<KeyedService> BuildEventRouter(
content::BrowserContext* context) { … }
}
class TabGroupsApiUnitTest : public ExtensionServiceTestBase { … };
void TabGroupsApiUnitTest::SetUp() { … }
void TabGroupsApiUnitTest::TearDown() { … }
TEST_F(TabGroupsApiUnitTest, TabStripModelWithNoTabGroupFails) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsQueryTitle) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsQueryColor) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsGetSuccess) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsGetError) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsUpdateSuccess) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsUpdateError) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsUpdateSavedTab) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsMoveRight) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsMoveAdjacentGroupRight) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsMoveGroupCannotMoveToTheMiddleOfAGroup) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsMoveLeft) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsMoveAcrossWindows) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsMoveToPinnedError) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsMoveToOtherGroupError) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsOnCreated) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsOnUpdated) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsOnRemoved) { … }
TEST_F(TabGroupsApiUnitTest, TabGroupsOnMoved) { … }
TEST_F(TabGroupsApiUnitTest, IsTabStripEditable) { … }
}