Commit 7524de1e authored by Achuith Bhandarkar's avatar Achuith Bhandarkar Committed by Commit Bot

Make autotest_private chromeos only.

BUG=None
Test=browser tests.

Change-Id: Ifa7477e130ffb8e7b526a40d903382c9dce9e116
Reviewed-on: https://chromium-review.googlesource.com/1235715Reviewed-by: default avatarBen Wells <benwells@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: Achuith Bhandarkar <achuith@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595022}
parent 0946cba1
...@@ -92,6 +92,8 @@ source_set("chromeos") { ...@@ -92,6 +92,8 @@ source_set("chromeos") {
"//chromeos/components/proximity_auth/logging", "//chromeos/components/proximity_auth/logging",
"//chromeos/components/tether", "//chromeos/components/tether",
"//chromeos/services/device_sync/public/cpp", "//chromeos/services/device_sync/public/cpp",
"//chromeos/services/machine_learning/public/cpp",
"//chromeos/services/machine_learning/public/mojom",
"//chromeos/services/multidevice_setup/public/cpp", "//chromeos/services/multidevice_setup/public/cpp",
"//chromeos/services/multidevice_setup/public/cpp:android_sms_app_helper_delegate", "//chromeos/services/multidevice_setup/public/cpp:android_sms_app_helper_delegate",
"//chromeos/services/multidevice_setup/public/cpp:android_sms_pairing_state_tracker", "//chromeos/services/multidevice_setup/public/cpp:android_sms_pairing_state_tracker",
...@@ -1839,6 +1841,8 @@ source_set("chromeos") { ...@@ -1839,6 +1841,8 @@ source_set("chromeos") {
# Extension API implementations. # Extension API implementations.
"extensions/arc_apps_private_api.cc", "extensions/arc_apps_private_api.cc",
"extensions/arc_apps_private_api.h", "extensions/arc_apps_private_api.h",
"extensions/autotest_private/autotest_private_api.cc",
"extensions/autotest_private/autotest_private_api.h",
"extensions/backdrop_wallpaper_handlers/backdrop_wallpaper_handlers.cc", "extensions/backdrop_wallpaper_handlers/backdrop_wallpaper_handlers.cc",
"extensions/backdrop_wallpaper_handlers/backdrop_wallpaper_handlers.h", "extensions/backdrop_wallpaper_handlers/backdrop_wallpaper_handlers.h",
"extensions/echo_private_api.cc", "extensions/echo_private_api.cc",
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" #include "chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h"
#include <memory> #include <memory>
#include <sstream> #include <sstream>
...@@ -75,8 +75,7 @@ std::unique_ptr<base::ListValue> GetHostPermissions(const Extension* ext, ...@@ -75,8 +75,7 @@ std::unique_ptr<base::ListValue> GetHostPermissions(const Extension* ext,
auto permissions = std::make_unique<base::ListValue>(); auto permissions = std::make_unique<base::ListValue>();
for (URLPatternSet::const_iterator perm = pattern_set.begin(); for (URLPatternSet::const_iterator perm = pattern_set.begin();
perm != pattern_set.end(); perm != pattern_set.end(); ++perm) {
++perm) {
permissions->AppendString(perm->GetAsString()); permissions->AppendString(perm->GetAsString());
} }
...@@ -241,8 +240,9 @@ AutotestPrivateLockScreenFunction::~AutotestPrivateLockScreenFunction() = ...@@ -241,8 +240,9 @@ AutotestPrivateLockScreenFunction::~AutotestPrivateLockScreenFunction() =
ExtensionFunction::ResponseAction AutotestPrivateLockScreenFunction::Run() { ExtensionFunction::ResponseAction AutotestPrivateLockScreenFunction::Run() {
DVLOG(1) << "AutotestPrivateLockScreenFunction"; DVLOG(1) << "AutotestPrivateLockScreenFunction";
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
chromeos::DBusThreadManager::Get()->GetSessionManagerClient()-> chromeos::DBusThreadManager::Get()
RequestLockScreen(); ->GetSessionManagerClient()
->RequestLockScreen();
#endif #endif
return RespondNow(NoArguments()); return RespondNow(NoArguments());
} }
...@@ -266,8 +266,7 @@ AutotestPrivateGetExtensionsInfoFunction::Run() { ...@@ -266,8 +266,7 @@ AutotestPrivateGetExtensionsInfoFunction::Run() {
ExtensionList all; ExtensionList all;
all.insert(all.end(), extensions.begin(), extensions.end()); all.insert(all.end(), extensions.begin(), extensions.end());
all.insert(all.end(), disabled_extensions.begin(), disabled_extensions.end()); all.insert(all.end(), disabled_extensions.begin(), disabled_extensions.end());
for (ExtensionList::const_iterator it = all.begin(); for (ExtensionList::const_iterator it = all.begin(); it != all.end(); ++it) {
it != all.end(); ++it) {
const Extension* extension = it->get(); const Extension* extension = it->get();
std::string id = extension->id(); std::string id = extension->id();
std::unique_ptr<base::DictionaryValue> extension_value( std::unique_ptr<base::DictionaryValue> extension_value(
...@@ -289,10 +288,8 @@ AutotestPrivateGetExtensionsInfoFunction::Run() { ...@@ -289,10 +288,8 @@ AutotestPrivateGetExtensionsInfoFunction::Run() {
extension_value->Set("apiPermissions", GetAPIPermissions(extension)); extension_value->Set("apiPermissions", GetAPIPermissions(extension));
Manifest::Location location = extension->location(); Manifest::Location location = extension->location();
extension_value->SetBoolean("isComponent", extension_value->SetBoolean("isComponent", location == Manifest::COMPONENT);
location == Manifest::COMPONENT); extension_value->SetBoolean("isInternal", location == Manifest::INTERNAL);
extension_value->SetBoolean("isInternal",
location == Manifest::INTERNAL);
extension_value->SetBoolean("isUserInstalled", extension_value->SetBoolean("isUserInstalled",
location == Manifest::INTERNAL || location == Manifest::INTERNAL ||
Manifest::IsUnpackedLocation(location)); Manifest::IsUnpackedLocation(location));
...@@ -312,7 +309,7 @@ AutotestPrivateGetExtensionsInfoFunction::Run() { ...@@ -312,7 +309,7 @@ AutotestPrivateGetExtensionsInfoFunction::Run() {
return RespondNow(OneArgument(std::move(return_value))); return RespondNow(OneArgument(std::move(return_value)));
} }
static int AccessArray(const volatile int arr[], const volatile int *index) { static int AccessArray(const volatile int arr[], const volatile int* index) {
return arr[*index]; return arr[*index];
} }
...@@ -904,10 +901,8 @@ BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor( ...@@ -904,10 +901,8 @@ BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor(
return new AutotestPrivateAPI(); return new AutotestPrivateAPI();
} }
AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) {}
}
AutotestPrivateAPI::~AutotestPrivateAPI() { AutotestPrivateAPI::~AutotestPrivateAPI() {}
}
} // namespace extensions } // namespace extensions
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_ #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_ #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
#include <string> #include <string>
...@@ -404,9 +404,9 @@ class AutotestPrivateAPI : public BrowserContextKeyedAPI { ...@@ -404,9 +404,9 @@ class AutotestPrivateAPI : public BrowserContextKeyedAPI {
template <> template <>
KeyedService* KeyedService*
BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor( BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor(
content::BrowserContext* context) const; content::BrowserContext* context) const;
} // namespace extensions } // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_ #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/browser/chromeos/arc/arc_session_manager.h" #include "chrome/browser/chromeos/arc/arc_session_manager.h"
#include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" #include "chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h"
#include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_apitest.h"
#include "components/arc/arc_util.h" #include "components/arc/arc_util.h"
......
...@@ -59,8 +59,6 @@ jumbo_static_library("extensions") { ...@@ -59,8 +59,6 @@ jumbo_static_library("extensions") {
"api/automation_internal/automation_event_router.h", "api/automation_internal/automation_event_router.h",
"api/automation_internal/automation_internal_api.cc", "api/automation_internal/automation_internal_api.cc",
"api/automation_internal/automation_internal_api.h", "api/automation_internal/automation_internal_api.h",
"api/autotest_private/autotest_private_api.cc",
"api/autotest_private/autotest_private_api.h",
"api/bookmark_manager_private/bookmark_manager_private_api.cc", "api/bookmark_manager_private/bookmark_manager_private_api.cc",
"api/bookmark_manager_private/bookmark_manager_private_api.h", "api/bookmark_manager_private/bookmark_manager_private_api.h",
"api/bookmarks/bookmark_api_constants.cc", "api/bookmarks/bookmark_api_constants.cc",
...@@ -997,8 +995,6 @@ jumbo_static_library("extensions") { ...@@ -997,8 +995,6 @@ jumbo_static_library("extensions") {
"//ash/public/cpp", "//ash/public/cpp",
"//chromeos/components/proximity_auth", "//chromeos/components/proximity_auth",
"//chromeos/services/ime/public/mojom", "//chromeos/services/ime/public/mojom",
"//chromeos/services/machine_learning/public/cpp",
"//chromeos/services/machine_learning/public/mojom",
"//components/arc", "//components/arc",
"//components/chrome_apps", "//components/chrome_apps",
"//components/constrained_window", "//components/constrained_window",
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
// API for integration testing. To be used on test images with a test component // API for integration testing. To be used on test images with a test component
// extension. // extension.
[platforms=("chromeos"),
implemented_in="chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h"]
namespace autotestPrivate { namespace autotestPrivate {
dictionary LoginStatusDict { dictionary LoginStatusDict {
......
...@@ -1622,6 +1622,7 @@ test("browser_tests") { ...@@ -1622,6 +1622,7 @@ test("browser_tests") {
"../browser/chromeos/extensions/accessibility_features_apitest.cc", "../browser/chromeos/extensions/accessibility_features_apitest.cc",
"../browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc", "../browser/chromeos/extensions/action_handlers/action_handlers_apitest.cc",
"../browser/chromeos/extensions/arc_apps_private_apitest.cc", "../browser/chromeos/extensions/arc_apps_private_apitest.cc",
"../browser/chromeos/extensions/autotest_private/autotest_private_apitest.cc",
"../browser/chromeos/extensions/default_keyboard_extension_browser_test.cc", "../browser/chromeos/extensions/default_keyboard_extension_browser_test.cc",
"../browser/chromeos/extensions/default_keyboard_extension_browser_test.h", "../browser/chromeos/extensions/default_keyboard_extension_browser_test.h",
"../browser/chromeos/extensions/echo_private_apitest.cc", "../browser/chromeos/extensions/echo_private_apitest.cc",
...@@ -1766,7 +1767,6 @@ test("browser_tests") { ...@@ -1766,7 +1767,6 @@ test("browser_tests") {
"../browser/chromeos/system/device_disabling_browsertest.cc", "../browser/chromeos/system/device_disabling_browsertest.cc",
"../browser/chromeos/system/tray_accessibility_browsertest.cc", "../browser/chromeos/system/tray_accessibility_browsertest.cc",
"../browser/drive/drive_notification_manager_factory_browsertest.cc", "../browser/drive/drive_notification_manager_factory_browsertest.cc",
"../browser/extensions/api/autotest_private/autotest_private_apitest.cc",
"../browser/extensions/api/certificate_provider/certificate_provider_apitest.cc", "../browser/extensions/api/certificate_provider/certificate_provider_apitest.cc",
"../browser/extensions/api/networking_private/networking_private_apitest.cc", "../browser/extensions/api/networking_private/networking_private_apitest.cc",
"../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc", "../browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment