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

Unified Diff: chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js

Issue 13896006: filemanager: Add a browsertest for the sidebar item "Shared with Me". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments, remove debug lines. Created 7 years, 8 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: chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
diff --git a/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js b/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
index 747f41a5b153962f66955c24c1e2096d1ccb572b..ddf10da8bc5cb0c63daf33fcb5231bb087bfc79e 100644
--- a/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
+++ b/chrome/test/data/extensions/api_test/file_manager_browsertest/test_cases.js
@@ -25,7 +25,8 @@ var EXPECTED_FILES_BEFORE_DRIVE = [
['world.mpeg', '1,000 bytes', 'MPEG video', 'Jul 4, 2012 10:35 AM'],
['My Desktop Background.png', '1 KB', 'PNG image', 'Jan 18, 2038 1:02 AM'],
['photos', '--', 'Folder', 'Jan 1, 1980 11:59 PM'],
- ['Test Document.gdoc','--','Google document','Apr 10, 2013 4:20 PM']
+ ['Test Document.gdoc','--','Google document','Apr 10, 2013 4:20 PM'],
+ ['Test Shared Document.gdoc','--','Google document','Mar 20, 2013 10:40 PM']
].sort();
/**
@@ -74,6 +75,7 @@ var EXPECTED_FILES_IN_RECENT = [
['world.mpeg', '1,000 bytes', 'MPEG video', 'Jul 4, 2012 10:35 AM'],
['My Desktop Background.png', '1 KB', 'PNG image', 'Jan 18, 2038 1:02 AM'],
['Test Document.gdoc','--','Google document','Apr 10, 2013 4:20 PM'],
+ ['Test Shared Document.gdoc','--','Google document','Mar 20, 2013 10:40 PM']
].sort();
/**
@@ -88,6 +90,16 @@ var EXPECTED_FILES_IN_OFFLINE = [
];
/**
+ * Expected files shown in "Shared with me", which should be the entries labeled
+ * with "shared-with-me".
+ * @type {Array.<Array.<string>>}
+ * @const
+ */
+var EXPECTED_FILES_IN_SHARED_WITH_ME = [
+ ['Test Shared Document.gdoc','--','Google document','Mar 20, 2013 10:40 PM']
+];
+
+/**
* Namespace for test cases.
*/
var testcase = {};
@@ -237,6 +249,31 @@ testcase.openSidebarOffline = function() {
};
/**
+ * Tests opening the "Shared with me" on the sidebar navigation by clicking the
+ * icon, and checks contents of the file list. Only the entries labeled with
+ * "shared-with-me" should be shown.
+ */
+testcase.openSidebarSharedWithMe = function() {
+ var onFileListChange = chrome.test.callbackPass(function(actualFilesAfter) {
+ chrome.test.assertEq(EXPECTED_FILES_IN_SHARED_WITH_ME, actualFilesAfter);
+ });
+
+ setupAndWaitUntilReady('/drive/root/', function(appId) {
+ // Use the icon for a click target.
+ callRemoteTestUtil(
+ 'fakeMouseClick', appId, ['[volume-type-icon=drive_shared_with_me]'],
+ function(result) {
+ chrome.test.assertFalse(!result);
+ callRemoteTestUtil(
+ 'waitForFileListChange',
+ appId,
+ [getExpectedFilesBefore(true /* isDrive */).length],
+ onFileListChange);
+ });
+ });
+};
+
+/**
* Tests autocomplete with a query 'hello'. This test is only available for
* Drive.
*/

Powered by Google App Engine
This is Rietveld 408576698