Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1160)

Unified Diff: chrome/browser/chromeos/file_manager/file_manager_browsertest.cc

Issue 1145893002: Add a test for requesting mount via a context menu in Files app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/file_manager/integration_tests/file_manager/providers.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
index 21e04e050aa9b63d2aff15cedda8d4cafa7bc29b..5546d59fce09e4a5cccc35d800d7ae29a69b611d 100644
--- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
+++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
@@ -546,6 +546,9 @@ class FileManagerBrowserTestBase : public ExtensionApiTest {
// Adds an incognito and guest-mode flags for tests in the guest mode.
void SetUpCommandLine(base::CommandLine* command_line) override;
+ // Installs an extension at the specified |path| using the |manifest_name|
+ // manifest.
+ void InstallExtension(const base::FilePath& path, const char* manifest_name);
// Loads our testing extension and sends it a string identifying the current
// test.
virtual void StartTest();
@@ -621,17 +624,22 @@ void FileManagerBrowserTestBase::SetUpCommandLine(
ExtensionApiTest::SetUpCommandLine(command_line);
}
-void FileManagerBrowserTestBase::StartTest() {
+void FileManagerBrowserTestBase::InstallExtension(const base::FilePath& path,
+ const char* manifest_name) {
base::FilePath root_path;
ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &root_path));
// Launch the extension.
- const base::FilePath path =
- root_path.Append(FILE_PATH_LITERAL("ui/file_manager/integration_tests"));
+ const base::FilePath absolute_path = root_path.Append(path);
const extensions::Extension* const extension =
- LoadExtensionAsComponentWithManifest(path, GetTestManifestName());
+ LoadExtensionAsComponentWithManifest(absolute_path, manifest_name);
ASSERT_TRUE(extension);
+}
+void FileManagerBrowserTestBase::StartTest() {
+ InstallExtension(
+ base::FilePath(FILE_PATH_LITERAL("ui/file_manager/integration_tests")),
+ GetTestManifestName());
RunTestMessageLoop();
}
@@ -785,6 +793,13 @@ void FileManagerBrowserTestBase::OnMessage(const std::string& name,
return;
}
+ if (name == "installProviderExtension") {
+ InstallExtension(base::FilePath(FILE_PATH_LITERAL(
+ "ui/file_manager/integration_tests/testing_provider")),
+ "manifest.json");
+ return;
+ }
+
FAIL() << "Unknown test message: " << name;
}
@@ -1209,6 +1224,11 @@ WRAPPED_INSTANTIATE_TEST_CASE_P(
TestParameter(IN_GUEST_MODE, "showGridViewDownloads"),
TestParameter(NOT_IN_GUEST_MODE, "showGridViewDrive")));
+WRAPPED_INSTANTIATE_TEST_CASE_P(
+ Providers,
+ FileManagerBrowserTest,
+ ::testing::Values(TestParameter(NOT_IN_GUEST_MODE, "requestMount")));
+
// Structure to describe an account info.
struct TestAccountInfo {
const char* const gaia_id;
« no previous file with comments | « no previous file | ui/file_manager/integration_tests/file_manager/providers.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698