Commit 7580ff42 authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Turn on Plugin VM UI for linux-chromeos when feature on

It is helpful to use linux-chromeos to see parts of the settings and
FilesApp UI which relate to Plugin VM.

Change-Id: I4f51642e87d52fd35b125df540173c72d4022ade
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2466545
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Auto-Submit: Joel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarTimothy Loh <timloh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#816498}
parent 7753bf7a
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_features.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_features.h"
#include "base/feature_list.h" #include "base/feature_list.h"
#include "base/system/sys_info.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_pref_names.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_pref_names.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
...@@ -61,8 +62,8 @@ bool PluginVmFeatures::IsAllowed(const Profile* profile) { ...@@ -61,8 +62,8 @@ bool PluginVmFeatures::IsAllowed(const Profile* profile) {
if (!base::FeatureList::IsEnabled(features::kPluginVm)) if (!base::FeatureList::IsEnabled(features::kPluginVm))
return false; return false;
// Bypass other checks when a fake policy is set // Bypass other checks when a fake policy is set, or running linux-chromeos.
if (FakeLicenseKeyIsSet()) if (FakeLicenseKeyIsSet() || !base::SysInfo::IsRunningOnChromeOS())
return true; return true;
// Check that the device is enterprise enrolled. // Check that the device is enterprise enrolled.
......
...@@ -6,11 +6,14 @@ ...@@ -6,11 +6,14 @@
#include "ash/public/cpp/shelf_item_delegate.h" #include "ash/public/cpp/shelf_item_delegate.h"
#include "ash/public/cpp/shelf_model.h" #include "ash/public/cpp/shelf_model.h"
#include "base/system/sys_info.h"
#include "base/time/time.h"
#include "chrome/browser/chromeos/login/users/mock_user_manager.h" #include "chrome/browser/chromeos/login/users/mock_user_manager.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_features.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_features.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_pref_names.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_pref_names.h"
#include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h" #include "chrome/browser/chromeos/plugin_vm/plugin_vm_util.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/chromeos/scoped_set_running_on_chromeos_for_testing.h"
#include "chrome/browser/chromeos/settings/cros_settings.h" #include "chrome/browser/chromeos/settings/cros_settings.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
...@@ -29,6 +32,9 @@ const char kDiskImageImportCommandUuid[] = "3922722bd7394acf85bf4d5a330d4a47"; ...@@ -29,6 +32,9 @@ const char kDiskImageImportCommandUuid[] = "3922722bd7394acf85bf4d5a330d4a47";
const char kPluginVmLicenseKey[] = "LICENSE_KEY"; const char kPluginVmLicenseKey[] = "LICENSE_KEY";
const char kDomain[] = "example.com"; const char kDomain[] = "example.com";
const char kDeviceId[] = "device_id"; const char kDeviceId[] = "device_id";
const char kLsbRelease[] =
"CHROMEOS_RELEASE_NAME=Chrome OS\n"
"CHROMEOS_RELEASE_VERSION=1.2.3.4\n";
// For adding a fake shelf item without requiring opening an actual window. // For adding a fake shelf item without requiring opening an actual window.
class FakeShelfItemDelegate : public ash::ShelfItemDelegate { class FakeShelfItemDelegate : public ash::ShelfItemDelegate {
...@@ -118,6 +124,9 @@ void PluginVmTestHelper::SetUserRequirementsToAllowPluginVm() { ...@@ -118,6 +124,9 @@ void PluginVmTestHelper::SetUserRequirementsToAllowPluginVm() {
account_id, true, user_manager::USER_TYPE_REGULAR); account_id, true, user_manager::USER_TYPE_REGULAR);
scoped_user_manager_ = std::make_unique<user_manager::ScopedUserManager>( scoped_user_manager_ = std::make_unique<user_manager::ScopedUserManager>(
std::move(mock_user_manager)); std::move(mock_user_manager));
fake_release_ =
std::make_unique<chromeos::ScopedSetRunningOnChromeOSForTesting>(
kLsbRelease, base::Time::Now());
} }
void PluginVmTestHelper::EnablePluginVmFeature() { void PluginVmTestHelper::EnablePluginVmFeature() {
......
...@@ -10,6 +10,10 @@ ...@@ -10,6 +10,10 @@
class TestingProfile; class TestingProfile;
namespace chromeos {
class ScopedSetRunningOnChromeOSForTesting;
} // namespace chromeos
namespace user_manager { namespace user_manager {
class ScopedUserManager; class ScopedUserManager;
} // namespace user_manager } // namespace user_manager
...@@ -47,6 +51,7 @@ class PluginVmTestHelper { ...@@ -47,6 +51,7 @@ class PluginVmTestHelper {
TestingProfile* testing_profile_; TestingProfile* testing_profile_;
std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_; std::unique_ptr<user_manager::ScopedUserManager> scoped_user_manager_;
base::test::ScopedFeatureList scoped_feature_list_; base::test::ScopedFeatureList scoped_feature_list_;
std::unique_ptr<chromeos::ScopedSetRunningOnChromeOSForTesting> fake_release_;
DISALLOW_COPY_AND_ASSIGN(PluginVmTestHelper); DISALLOW_COPY_AND_ASSIGN(PluginVmTestHelper);
}; };
......
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