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

Unified Diff: ui/file_manager/integration_tests/file_manager/providers.js

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
Index: ui/file_manager/integration_tests/file_manager/providers.js
diff --git a/ui/file_manager/integration_tests/file_manager/providers.js b/ui/file_manager/integration_tests/file_manager/providers.js
new file mode 100644
index 0000000000000000000000000000000000000000..5c2a2bfe5d70ed913c6d8a3e2d22553ecf3ffe53
--- /dev/null
+++ b/ui/file_manager/integration_tests/file_manager/providers.js
@@ -0,0 +1,75 @@
+// Copyright 2015 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.
+
+'use strict';
+
+(function() {
+/**
+ * Tests if mounting a provided file system via the "Add new services" button
+ * works correctly.
+ */
+function requestMount() {
+ var appId;
+ StepsRunner.run([
+ function() {
+ chrome.test.sendMessage(
+ JSON.stringify({name: 'installProviderExtension'}));
+ setupAndWaitUntilReady(null, RootPath.DOWNLOADS, this.next);
+ },
+ function(inAppId) {
+ appId = inAppId;
+ remoteCall.callRemoteTestUtil(
+ 'fakeMouseClick',
+ appId,
+ ['div[menu=\'#add-new-services-menu\']'],
+ this.next);
+ },
+ function(result) {
+ chrome.test.assertTrue(result);
+ remoteCall.waitForElement(
+ appId,
+ '#add-new-services-menu:not([hidden]) cr-menu-item:first-child span')
+ .then(this.next);
+ },
+ function(result) {
+ chrome.test.assertEq('Testing Provider', result.text);
+ remoteCall.callRemoteTestUtil(
+ 'fakeMouseClick',
+ appId,
+ ['#add-new-services-menu cr-menu-item:first-child span'],
+ this.next);
+ },
+ function(result) {
+ remoteCall.waitForElement(
+ appId,
+ '.tree-row[selected] .icon[volume-type-icon="provided"]')
+ .then(this.next);
+ },
+ function(result) {
+ remoteCall.callRemoteTestUtil(
+ 'fakeMouseClick',
+ appId,
+ ['div[menu=\'#add-new-services-menu\']'],
+ this.next);
+ },
+ function(result) {
+ chrome.test.assertTrue(result);
+ // Confirm that the first element of the menu is now the separator, as
+ // the extension once mounted should be gone from the menu, as it doesn't
+ // support multiple mounts.
+ remoteCall.waitForElement(
+ appId,
+ '#add-new-services-menu:not([hidden]) hr:first-child')
+ .then(this.next);
+ },
+ function(result) {
+ checkIfNoErrorsOccured(this.next);
+ }
+ ]);
+}
+
+// Exports test functions.
+testcase.requestMount = requestMount;
+
+})();

Powered by Google App Engine
This is Rietveld 408576698