Commit b4268a4d authored by Joel Hockey's avatar Joel Hockey Committed by Commit Bot

Add a fileManagerPrivate.isCrostiniEnabled test

Additional test for fileManagerPrivate.mountCrostiniContainer
will be added to these files next.

Bug: 845075, 822130
Change-Id: I8e4fbb840764e975b5d670556905f3b4b411f2da
Reviewed-on: https://chromium-review.googlesource.com/1075878
Commit-Queue: Joel Hockey <joelhockey@chromium.org>
Reviewed-by: default avatarNoel Gordon <noel@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#563153}
parent b8a8373b
...@@ -7,17 +7,21 @@ ...@@ -7,17 +7,21 @@
#include "base/macros.h" #include "base/macros.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/test/scoped_feature_list.h"
#include "chrome/browser/chromeos/crostini/crostini_pref_names.h"
#include "chrome/browser/chromeos/extensions/file_manager/event_router.h" #include "chrome/browser/chromeos/extensions/file_manager/event_router.h"
#include "chrome/browser/chromeos/file_manager/file_watcher.h" #include "chrome/browser/chromeos/file_manager/file_watcher.h"
#include "chrome/browser/chromeos/file_manager/mount_test_util.h" #include "chrome/browser/chromeos/file_manager/mount_test_util.h"
#include "chrome/browser/chromeos/file_system_provider/icon_set.h" #include "chrome/browser/chromeos/file_system_provider/icon_set.h"
#include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h" #include "chrome/browser/chromeos/file_system_provider/provided_file_system_info.h"
#include "chrome/browser/extensions/extension_apitest.h" #include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h" #include "chrome/common/extensions/api/file_system_provider_capabilities/file_system_provider_capabilities_handler.h"
#include "chrome/test/base/testing_profile.h" #include "chrome/test/base/testing_profile.h"
#include "chromeos/dbus/cros_disks_client.h" #include "chromeos/dbus/cros_disks_client.h"
#include "chromeos/disks/mock_disk_mount_manager.h" #include "chromeos/disks/mock_disk_mount_manager.h"
#include "components/drive/file_change.h" #include "components/drive/file_change.h"
#include "components/prefs/pref_service.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
#include "extensions/common/install_warning.h" #include "extensions/common/install_warning.h"
#include "google_apis/drive/test_util.h" #include "google_apis/drive/test_util.h"
...@@ -471,3 +475,16 @@ IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, Recent) { ...@@ -471,3 +475,16 @@ IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, Recent) {
ASSERT_TRUE(RunComponentExtensionTest("file_browser/recent_test")); ASSERT_TRUE(RunComponentExtensionTest("file_browser/recent_test"));
} }
IN_PROC_BROWSER_TEST_F(FileManagerPrivateApiTest, Crostini) {
// TODO(joelhockey): Setting prefs and features to allow crostini is not
// ideal. It would be better if the crostini interface allowed for testing
// without such tight coupling.
browser()->profile()->GetPrefs()->SetBoolean(
crostini::prefs::kCrostiniEnabled, true);
base::test::ScopedFeatureList scoped_feature_list;
scoped_feature_list.InitWithFeatures(
{features::kCrostini, features::kExperimentalCrostiniUI}, {});
ASSERT_TRUE(RunComponentExtensionTest("file_browser/crostini_test"));
}
{
// chrome-extension://pkplfbidichfdicaijlchgnapepdginl
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtDfX9dHNh948bt00YhZBm3P6E5QLaOt+v8kXVtibQfiPtOD2FTScB/f0wX/EQWVO7BkaSOsRkTPcPIgocyMPYr2FLgqGLFlYT9nQpKJZUFNF5oJ5rG6Nv7ppf4zEB3j6da1IBRTz2yOZ+6O1TMZxol/V62/QcqrJeggsHTEPGLdr9Ua4b1Ka0xKJnJngZljsbw93FI1o+P9dAh5BS6wTPiZI/vmJVjvMTkSTnaZ3n9Go2t7A0XLcSxLcVyuLAd2mAvSN0mIviOukdM66wr7llif71nKuUt+4qvlr/r9HfwzN6pA4jkwhtS1UD+3CmB+wsHwsnohNcuu4FIQ6rgq/7QIDAQAB",
"name": "chrome.fileManagerPrivate tests",
"version": "0.1",
"manifest_version": 2,
"description": "Tests of chrome.fileManagerPrivate.isCrostiniEnabled",
"app": {
"background": {
"scripts": ["test.js"]
}
},
"permissions": [
"fileManagerPrivate"
]
}
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Run the tests.
chrome.test.runTests([
function testIsCrostiniEnabled() {
chrome.fileManagerPrivate.isCrostiniEnabled(
chrome.test.callbackPass((enabled) => {
chrome.test.assertTrue(enabled);
}));
},
]);
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