1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "base/command_line.h"
6 #include "base/values.h"
7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/common/extensions/api/search_engines_private.h"
9 #include "components/keyed_service/core/keyed_service.h"
10 #include "content/public/test/test_utils.h"
11 #include "extensions/common/switches.h"
13 namespace extensions
{
17 class SearchEnginesPrivateApiTest
: public ExtensionApiTest
{
19 SearchEnginesPrivateApiTest() {}
20 ~SearchEnginesPrivateApiTest() override
{}
22 void SetUpCommandLine(base::CommandLine
* command_line
) override
{
23 ExtensionApiTest::SetUpCommandLine(command_line
);
26 void SetUpOnMainThread() override
{
27 ExtensionApiTest::SetUpOnMainThread();
28 content::RunAllPendingInMessageLoop();
32 bool RunSearchEnginesSubtest(const std::string
& subtest
) {
33 return RunExtensionSubtest("search_engines_private",
34 "main.html?" + subtest
,
35 kFlagLoadAsComponent
);
39 DISALLOW_COPY_AND_ASSIGN(SearchEnginesPrivateApiTest
);
44 IN_PROC_BROWSER_TEST_F(SearchEnginesPrivateApiTest
,
45 DISABLED_SetSelectedSearchEngine
) {
46 EXPECT_TRUE(RunSearchEnginesSubtest("setSelectedSearchEngine")) << message_
;
49 IN_PROC_BROWSER_TEST_F(SearchEnginesPrivateApiTest
, OnSearchEnginesChanged
) {
50 EXPECT_TRUE(RunSearchEnginesSubtest("onDefaultSearchEnginesChanged"))
54 IN_PROC_BROWSER_TEST_F(SearchEnginesPrivateApiTest
, AddNewSearchEngine
) {
55 EXPECT_TRUE(RunSearchEnginesSubtest("addNewSearchEngine")) << message_
;
58 IN_PROC_BROWSER_TEST_F(SearchEnginesPrivateApiTest
, UpdateSearchEngine
) {
59 EXPECT_TRUE(RunSearchEnginesSubtest("updateSearchEngine")) << message_
;
62 IN_PROC_BROWSER_TEST_F(SearchEnginesPrivateApiTest
, RemoveSearchEngine
) {
63 EXPECT_TRUE(RunSearchEnginesSubtest("removeSearchEngine")) << message_
;
66 } // namespace extensions