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") {
"//chromeos/components/proximity_auth/logging",
"//chromeos/components/tether",
"//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:android_sms_app_helper_delegate",
"//chromeos/services/multidevice_setup/public/cpp:android_sms_pairing_state_tracker",
......@@ -1839,6 +1841,8 @@ source_set("chromeos") {
# Extension API implementations.
"extensions/arc_apps_private_api.cc",
"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.h",
"extensions/echo_private_api.cc",
......
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// 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 <sstream>
......@@ -75,8 +75,7 @@ std::unique_ptr<base::ListValue> GetHostPermissions(const Extension* ext,
auto permissions = std::make_unique<base::ListValue>();
for (URLPatternSet::const_iterator perm = pattern_set.begin();
perm != pattern_set.end();
++perm) {
perm != pattern_set.end(); ++perm) {
permissions->AppendString(perm->GetAsString());
}
......@@ -241,8 +240,9 @@ AutotestPrivateLockScreenFunction::~AutotestPrivateLockScreenFunction() =
ExtensionFunction::ResponseAction AutotestPrivateLockScreenFunction::Run() {
DVLOG(1) << "AutotestPrivateLockScreenFunction";
#if defined(OS_CHROMEOS)
chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->
RequestLockScreen();
chromeos::DBusThreadManager::Get()
->GetSessionManagerClient()
->RequestLockScreen();
#endif
return RespondNow(NoArguments());
}
......@@ -266,8 +266,7 @@ AutotestPrivateGetExtensionsInfoFunction::Run() {
ExtensionList all;
all.insert(all.end(), extensions.begin(), extensions.end());
all.insert(all.end(), disabled_extensions.begin(), disabled_extensions.end());
for (ExtensionList::const_iterator it = all.begin();
it != all.end(); ++it) {
for (ExtensionList::const_iterator it = all.begin(); it != all.end(); ++it) {
const Extension* extension = it->get();
std::string id = extension->id();
std::unique_ptr<base::DictionaryValue> extension_value(
......@@ -289,13 +288,11 @@ AutotestPrivateGetExtensionsInfoFunction::Run() {
extension_value->Set("apiPermissions", GetAPIPermissions(extension));
Manifest::Location location = extension->location();
extension_value->SetBoolean("isComponent",
location == Manifest::COMPONENT);
extension_value->SetBoolean("isInternal",
location == Manifest::INTERNAL);
extension_value->SetBoolean("isComponent", location == Manifest::COMPONENT);
extension_value->SetBoolean("isInternal", location == Manifest::INTERNAL);
extension_value->SetBoolean("isUserInstalled",
location == Manifest::INTERNAL ||
Manifest::IsUnpackedLocation(location));
location == Manifest::INTERNAL ||
Manifest::IsUnpackedLocation(location));
extension_value->SetBoolean("isEnabled", service->IsExtensionEnabled(id));
extension_value->SetBoolean(
"allowedInIncognito", util::IsIncognitoEnabled(id, browser_context()));
......@@ -312,7 +309,7 @@ AutotestPrivateGetExtensionsInfoFunction::Run() {
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];
}
......@@ -904,10 +901,8 @@ BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor(
return new AutotestPrivateAPI();
}
AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) {
}
AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) {}
AutotestPrivateAPI::~AutotestPrivateAPI() {
}
AutotestPrivateAPI::~AutotestPrivateAPI() {}
} // namespace extensions
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
#ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
#define CHROME_BROWSER_CHROMEOS_EXTENSIONS_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_
#include <string>
......@@ -382,7 +382,7 @@ void SetAutotestPrivateTest();
class AutotestPrivateAPI : public BrowserContextKeyedAPI {
public:
static BrowserContextKeyedAPIFactory<AutotestPrivateAPI>*
GetFactoryInstance();
GetFactoryInstance();
// TODO(achuith): Replace these with a mock object for system calls.
bool test_mode() const { return test_mode_; }
......@@ -404,9 +404,9 @@ class AutotestPrivateAPI : public BrowserContextKeyedAPI {
template <>
KeyedService*
BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor(
content::BrowserContext* context) const;
BrowserContextKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor(
content::BrowserContext* context) const;
} // 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 @@
#include "build/build_config.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 "components/arc/arc_util.h"
......
......@@ -59,8 +59,6 @@ jumbo_static_library("extensions") {
"api/automation_internal/automation_event_router.h",
"api/automation_internal/automation_internal_api.cc",
"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.h",
"api/bookmarks/bookmark_api_constants.cc",
......@@ -997,8 +995,6 @@ jumbo_static_library("extensions") {
"//ash/public/cpp",
"//chromeos/components/proximity_auth",
"//chromeos/services/ime/public/mojom",
"//chromeos/services/machine_learning/public/cpp",
"//chromeos/services/machine_learning/public/mojom",
"//components/arc",
"//components/chrome_apps",
"//components/constrained_window",
......
......@@ -4,6 +4,8 @@
// API for integration testing. To be used on test images with a test component
// extension.
[platforms=("chromeos"),
implemented_in="chrome/browser/chromeos/extensions/autotest_private/autotest_private_api.h"]
namespace autotestPrivate {
dictionary LoginStatusDict {
......
......@@ -1622,6 +1622,7 @@ test("browser_tests") {
"../browser/chromeos/extensions/accessibility_features_apitest.cc",
"../browser/chromeos/extensions/action_handlers/action_handlers_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.h",
"../browser/chromeos/extensions/echo_private_apitest.cc",
......@@ -1766,7 +1767,6 @@ test("browser_tests") {
"../browser/chromeos/system/device_disabling_browsertest.cc",
"../browser/chromeos/system/tray_accessibility_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/networking_private/networking_private_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