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

Unified Diff: chrome/test/data/extensions/api_test/filebrowser_mount/test.js

Issue 10231010: gdata: Apply correct mount label when mounting archives in GData (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 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
« no previous file with comments | « chrome/common/extensions/api/fileBrowserPrivate.json ('k') | chromeos/dbus/cros_disks_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/filebrowser_mount/test.js
diff --git a/chrome/test/data/extensions/api_test/filebrowser_mount/test.js b/chrome/test/data/extensions/api_test/filebrowser_mount/test.js
index a35a8124d0e1f638d8ce428d1b15f1d566b584ba..b6b6812e3ab4e0b8c7f74dc28e30a6875e836a54 100644
--- a/chrome/test/data/extensions/api_test/filebrowser_mount/test.js
+++ b/chrome/test/data/extensions/api_test/filebrowser_mount/test.js
@@ -49,62 +49,37 @@ var expectedVolume3 = {
};
// List of expected mount points.
-// We have to treat archives specially because their sourceUrl is set to
-// filesystem url. To make it easier to define expectation for archives,
-// instead of sourceUrl, we set sourcePath that will be converted to filesystem
-// url when received mountPoint is verified.
// NOTE: this has to be synced with values in file_browser_private_apitest.cc
// and values sorted by mountPath.
var expectedMountPoints = [
{
- sourcePath: 'removable/archive_path',
+ sourcePath: '/media/removable/archive_path',
mountPath: 'archive/archive_mount_path',
mountType: 'file',
mountCondition: ''
},
{
- sourceUrl: 'device_path1',
+ sourcePath: 'device_path1',
mountPath: 'removable/mount_path1',
mountType: 'device',
mountCondition: ''
},
{
- sourceUrl: 'device_path2',
+ sourcePath: 'device_path2',
mountPath: 'removable/mount_path2',
mountType: 'device',
mountCondition: ''
},
{
- sourceUrl: 'device_path3',
+ sourcePath: 'device_path3',
mountPath: 'removable/mount_path3',
mountType: 'device',
mountCondition: ''
}
];
-function treatMountPointException(received, expected, key) {
- if (key != 'sourcePath')
- return { wasValidated: false, success: false };
- var expectedSourceUrl = createFileUrl(expected[key]);
- var success = (expectedSourceUrl == received['sourceUrl']);
- if (!success)
- console.warn("Expected mount point's sourceUrl to be '" +
- expectedSourceUrl + "' but got '" + received['sourceUrl'] +
- "' instead.");
- return { wasValidated: true, success: success };
-}
-
-function validateObject(received, expected, name, treatException) {
+function validateObject(received, expected, name) {
for (var key in expected) {
- var validated = treatException &&
- treatException(received, expected, key);
- if (validated && validated.wasValidated) {
- if (validated.success) {
- continue;
- } else {
- return false;
- }
- }
if (received[key] != expected[key]) {
console.warn('Expected "' + key + '" ' + name + ' property to be: "' +
expected[key] + '"' + ', but got: "' + received[key] +
@@ -198,8 +173,7 @@ chrome.test.runTests([
'getMountPoints returned wrong number of mount points.');
for (var i = 0; i < expectedMountPoints.length; i++) {
chrome.test.assertTrue(
- validateObject(result[i], expectedMountPoints[i], 'mountPoint',
- treatMountPointException),
+ validateObject(result[i], expectedMountPoints[i], 'mountPoint'),
'getMountPoints result[' + i + '] not as expected');
}
}));
« no previous file with comments | « chrome/common/extensions/api/fileBrowserPrivate.json ('k') | chromeos/dbus/cros_disks_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698