Chromium Code Reviews| OLD | NEW |
|---|---|
| 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.experimental.mediaGalleries; | 5 var mediaGalleries = chrome.experimental.mediaGalleries; |
| 6 var emptyListCallback = function(results) { | 6 var emptyListCallback = function(results) { |
|
vandebo (ex-Chrome)
2012/05/31 04:10:39
nit: change the name of the function.
Lei Zhang
2012/05/31 08:32:38
Done.
| |
| 7 chrome.test.assertEq(results, []); | 7 // There should be a "Pictures" directory on all desktop platforms. |
| 8 chrome.test.assertEq(1, results.length); | |
| 8 }; | 9 }; |
| 9 var nullCallback = function(result) { | 10 var nullCallback = function(result) { |
| 10 chrome.test.assertEq(result, null); | 11 chrome.test.assertEq(null, result); |
| 11 }; | 12 }; |
| 12 | 13 |
| 13 chrome.test.runTests([ | 14 chrome.test.runTests([ |
| 14 function getGalleries() { | 15 function getGalleries() { |
| 15 mediaGalleries.getMediaFileSystems( | 16 mediaGalleries.getMediaFileSystems( |
| 16 chrome.test.callbackPass(emptyListCallback)); | 17 chrome.test.callbackPass(emptyListCallback)); |
| 17 }, | 18 }, |
| 18 | 19 |
| 19 function openMediaGalleryManager() { | 20 function openMediaGalleryManager() { |
| 20 // Just confirm that the function exists. | 21 // Just confirm that the function exists. |
| 21 chrome.test.assertTrue(mediaGalleries.openMediaGalleryManager !== null); | 22 chrome.test.assertTrue(mediaGalleries.openMediaGalleryManager !== null); |
| 22 chrome.test.succeed() | 23 chrome.test.succeed() |
| 23 }, | 24 }, |
| 24 | 25 |
| 25 function extractEmbeddedThumbnails() { | 26 function extractEmbeddedThumbnails() { |
| 26 var result = mediaGalleries.extractEmbeddedThumbnails({}); | 27 var result = mediaGalleries.extractEmbeddedThumbnails({}); |
| 27 chrome.test.assertEq(result, null); | 28 chrome.test.assertEq(null, result); |
| 28 chrome.test.succeed() | 29 chrome.test.succeed() |
| 29 }, | 30 }, |
| 30 | 31 |
| 31 function assembleMediaFile() { | 32 function assembleMediaFile() { |
| 32 mediaGalleries.assembleMediaFile( | 33 mediaGalleries.assembleMediaFile( |
| 33 {}, {}, chrome.test.callbackPass(nullCallback)); | 34 {}, {}, chrome.test.callbackPass(nullCallback)); |
| 34 }, | 35 }, |
| 35 ]); | 36 ]); |
| OLD | NEW |