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

Unified Diff: chrome/test/data/extensions/api_test/media_galleries/read_access/test.js

Issue 24242010: Media Galleries: Refactor test to not need RunSecondPhase(). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 3 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/media_galleries/no_access/test.js ('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/media_galleries/read_access/test.js
===================================================================
--- chrome/test/data/extensions/api_test/media_galleries/read_access/test.js (revision 224775)
+++ chrome/test/data/extensions/api_test/media_galleries/read_access/test.js (working copy)
@@ -7,7 +7,8 @@
var galleries;
var testResults = [];
var foundGalleryWithEntry = false;
-var expectedGalleryEntryLength = 306; // hard-coded size of ../common/test.jpg
+var expectedFileSystems;
+var expectedGalleryEntryLength;
function checkFinished() {
if (testResults.length != galleries.length)
@@ -76,27 +77,32 @@
checkFinished();
};
-function testGalleries(expectedFileSystems) {
- chrome.test.assertEq(expectedFileSystems, galleries.length);
- if (expectedFileSystems == 0) {
- chrome.test.succeed();
- return;
- }
-
- for (var i = 0; i < galleries.length; i++) {
- var dirReader = galleries[i].root.createReader();
- dirReader.readEntries(mediaFileSystemsDirectoryEntryCallback,
- mediaFileSystemsDirectoryErrorCallback);
- }
-};
-
var mediaFileSystemsListCallback = function(results) {
galleries = results;
};
-chrome.test.runTests([
- function mediaGalleriesReadAccess() {
- mediaGalleries.getMediaFileSystems(
- chrome.test.callbackPass(mediaFileSystemsListCallback));
- },
-]);
+chrome.test.getConfig(function(config) {
+ customArg = JSON.parse(config.customArg);
+ expectedFileSystems = customArg[0];
+ expectedGalleryEntryLength = customArg[1];
+
+ chrome.test.runTests([
+ function getMediaFileSystems() {
+ mediaGalleries.getMediaFileSystems(
+ chrome.test.callbackPass(mediaFileSystemsListCallback));
+ },
+ function readFileSystems() {
+ chrome.test.assertEq(expectedFileSystems, galleries.length);
+ if (expectedFileSystems == 0) {
+ chrome.test.succeed();
+ return;
+ }
+
+ for (var i = 0; i < galleries.length; i++) {
+ var dirReader = galleries[i].root.createReader();
+ dirReader.readEntries(mediaFileSystemsDirectoryEntryCallback,
+ mediaFileSystemsDirectoryErrorCallback);
+ }
+ },
+ ]);
+})
« no previous file with comments | « chrome/test/data/extensions/api_test/media_galleries/no_access/test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698