#include "chrome/browser/extensions/api/search/search_api.h"
#include <string_view>
#include "base/memory/scoped_refptr.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_service_test_base.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
#include "chrome/browser/sessions/session_tab_helper_factory.h"
#include "chrome/test/base/search_test_utils.h"
#include "chrome/test/base/test_browser_window.h"
#include "components/search_engines/template_url_service.h"
#include "content/public/test/web_contents_tester.h"
#include "extensions/browser/api_test_utils.h"
#include "extensions/common/extension_builder.h"
namespace extensions {
namespace {
scoped_refptr<const Extension> CreateSearchExtension() { … }
scoped_refptr<SearchQueryFunction> CreateSearchFunction(
scoped_refptr<const Extension> extension) { … }
std::unique_ptr<content::WebContents> CreateWebContents(Browser* browser) { … }
}
class SearchApiUnitTest : public ExtensionServiceTestBase { … };
void SearchApiUnitTest::SetUp() { … }
void SearchApiUnitTest::TearDown() { … }
void SearchApiUnitTest::RunFunctionAndExpectError(
const std::string& input,
const std::string_view expected) { … }
TEST_F(SearchApiUnitTest, QueryEmpty) { … }
TEST_F(SearchApiUnitTest, DispositionAndTabIDValid) { … }
TEST_F(SearchApiUnitTest, InvalidTabId) { … }
TEST_F(SearchApiUnitTest, NoActiveBrowser) { … }
}