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

Unified Diff: chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js

Issue 374543002: [fsp] Simplify browser tests by extracting the common code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed. Created 6 years, 5 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/test/data/extensions/api_test/file_system_provider/unmount/manifest.json ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js
diff --git a/chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js b/chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js
index acefcafc3c741a954deaab517e5f03dda89362e0..1b7ea0d1376fc838694a1593f9b8b84549973c45 100644
--- a/chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js
+++ b/chrome/test/data/extensions/api_test/file_system_provider/unmount/test.js
@@ -17,26 +17,6 @@ var FIRST_FILE_SYSTEM_ID = 'vanilla';
var SECOND_FILE_SYSTEM_ID = 'ice-cream';
/**
- * Gets volume information for the provided file system.
- *
- * @param {string} fileSystemId Id of the provided file system.
- * @param {function(Object)} callback Callback to be called on result, with the
- * volume information object in case of success, or null if not found.
- */
-function getVolumeInfo(fileSystemId, callback) {
- chrome.fileBrowserPrivate.getVolumeMetadataList(function(volumeList) {
- for (var i = 0; i < volumeList.length; i++) {
- if (volumeList[i].extensionId == chrome.runtime.id &&
- volumeList[i].fileSystemId == fileSystemId) {
- callback(volumeList[i]);
- return;
- }
- }
- callback(null);
- });
-}
-
-/**
* Sets up the tests. Called once per all test cases. In case of a failure,
* the callback is not called.
*
@@ -128,7 +108,7 @@ function runTests() {
chrome.fileSystemProvider.onUnmountRequested.addListener(
onUnmountRequested);
- getVolumeInfo(SECOND_FILE_SYSTEM_ID, function(volumeInfo) {
+ test_util.getVolumeInfo(SECOND_FILE_SYSTEM_ID, function(volumeInfo) {
chrome.test.assertTrue(!!volumeInfo);
chrome.fileBrowserPrivate.removeMount(volumeInfo.volumeId);
});
@@ -171,7 +151,7 @@ function runTests() {
onUnmountRequested);
chrome.fileBrowserPrivate.onMountCompleted.addListener(onMountCompleted);
- getVolumeInfo(SECOND_FILE_SYSTEM_ID, function(volumeInfo) {
+ test_util.getVolumeInfo(SECOND_FILE_SYSTEM_ID, function(volumeInfo) {
chrome.test.assertTrue(!!volumeInfo);
chrome.fileBrowserPrivate.removeMount(volumeInfo.volumeId);
});
« no previous file with comments | « chrome/test/data/extensions/api_test/file_system_provider/unmount/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698