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

Side by Side Diff: chrome/test/data/extensions/api_test/media_galleries/no_access/test.js

Issue 24420003: Media Galleries: Run API tests in a temp directory with an injected common.js file. Avoid the need … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make it more obvious there's a JS file being injected into the test cases (try 2) Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/data/extensions/api_test/media_galleries/no_access/manifest.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var mediaGalleries = chrome.mediaGalleries; 5 var mediaGalleries = chrome.mediaGalleries;
6 6
7 var galleries; 7 var galleries;
8 var testResults = []; 8 var testResults = [];
9 var expectedFileSystems; 9 var expectedFileSystems;
10 10
(...skipping 20 matching lines...) Expand all
31 31
32 var mediaFileSystemsDirectoryErrorCallback = function(err) { 32 var mediaFileSystemsDirectoryErrorCallback = function(err) {
33 testResults.push(""); 33 testResults.push("");
34 checkFinished(); 34 checkFinished();
35 }; 35 };
36 36
37 var mediaFileSystemsListCallback = function(results) { 37 var mediaFileSystemsListCallback = function(results) {
38 galleries = results; 38 galleries = results;
39 }; 39 };
40 40
41 CreateDummyWindowToPreventSleep();
42
41 chrome.test.getConfig(function(config) { 43 chrome.test.getConfig(function(config) {
42 customArg = JSON.parse(config.customArg); 44 customArg = JSON.parse(config.customArg);
43 expectedFileSystems = customArg[0]; 45 expectedFileSystems = customArg[0];
44 46
45 chrome.test.runTests([ 47 chrome.test.runTests([
46 function getMediaFileSystems() { 48 function getMediaFileSystems() {
47 mediaGalleries.getMediaFileSystems( 49 mediaGalleries.getMediaFileSystems(
48 chrome.test.callbackPass(mediaFileSystemsListCallback)); 50 chrome.test.callbackPass(mediaFileSystemsListCallback));
49 }, 51 },
50 function testGalleries() { 52 function testGalleries() {
51 chrome.test.assertEq(expectedFileSystems, galleries.length); 53 chrome.test.assertEq(expectedFileSystems, galleries.length);
52 if (expectedFileSystems == 0) {
53 chrome.test.succeed();
54 return;
55 }
56
57 for (var i = 0; i < galleries.length; i++) { 54 for (var i = 0; i < galleries.length; i++) {
58 var dirReader = galleries[i].root.createReader(); 55 var dirReader = galleries[i].root.createReader();
59 dirReader.readEntries(mediaFileSystemsDirectoryEntryCallback, 56 dirReader.readEntries(mediaFileSystemsDirectoryEntryCallback,
60 mediaFileSystemsDirectoryErrorCallback); 57 mediaFileSystemsDirectoryErrorCallback);
61 } 58 }
62 }, 59 },
63 60 function validFileCopyToShouldFail() {
61 runCopyToTest(validWEBPImageCase, false /* expect failure */);
62 },
63 function invalidFileCopyToShouldFail() {
64 runCopyToTest(invalidWEBPImageCase, false /* expect failure */);
65 },
64 ]); 66 ]);
65 }) 67 })
OLDNEW
« no previous file with comments | « chrome/test/data/extensions/api_test/media_galleries/no_access/manifest.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698