Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/media_galleries/test.js |
| diff --git a/chrome/test/data/extensions/api_test/media_galleries/test.js b/chrome/test/data/extensions/api_test/media_galleries/test.js |
| index cbe69a3464cf4e82ea3c2f29adabbd5af28dea2f..734a7550b8a66eab4cc21ccedacf8af0f79fc706 100644 |
| --- a/chrome/test/data/extensions/api_test/media_galleries/test.js |
| +++ b/chrome/test/data/extensions/api_test/media_galleries/test.js |
| @@ -2,43 +2,45 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -var mediaGalleries = chrome.experimental.mediaGalleries; |
| -var mediaFileSystemsListCallback = function(results) { |
| - // There should be a "Pictures" directory on all desktop platforms. |
| - var expectedFileSystems = 1; |
| - // But not on Android and ChromeOS. |
| - if (/Android/.test(navigator.userAgent) || /CrOS/.test(navigator.userAgent)) { |
| - expectedFileSystems = 0; |
| - } |
| - chrome.test.assertEq(expectedFileSystems, results.length); |
| - // TODO(vandebo) Test that we can read from the file system object. |
| -}; |
| -var nullCallback = function(result) { |
| - chrome.test.assertEq(null, result); |
| -}; |
| +chrome.experimental.app.onLaunched.addListener(function() { |
| + var experimentalMediaGalleries = chrome.experimental.mediaGalleries; |
| + var mediaGalleries = chrome.mediaGalleries; |
| + var mediaFileSystemsListCallback = function(results) { |
| + // There should be a "Pictures" directory on all desktop platforms. |
| + var expectedFileSystems = 1; |
| + // But not on Android and ChromeOS. |
| + if (/Android/.test(navigator.userAgent) || /CrOS/.test(navigator.userAgent)) |
| + expectedFileSystems = 0; |
| + chrome.test.assertEq(expectedFileSystems, results.length); |
| + // TODO(vandebo) Test that we can read from the file system object. |
| + }; |
| + var nullCallback = function(result) { |
| + chrome.test.assertEq(null, result); |
| + }; |
| -function runTests(tests) { |
| - chrome.test.getConfig(function(config) { |
| - operatingSystem = config.osName; |
| - chrome.test.runTests(tests); |
| - }); |
| -} |
| + function runTests(tests) { |
| + chrome.test.getConfig(function(config) { |
| + operatingSystem = config.osName; |
| + chrome.test.runTests(tests); |
|
not at google - send to devlin
2012/07/24 04:56:21
I can see the code was already like this... but ha
Evan Stade
2012/07/24 17:31:33
yea, I think you are right. It still passes locall
|
| + }); |
| + } |
| -chrome.test.runTests([ |
| - function getGalleries() { |
| - mediaGalleries.getMediaFileSystems( |
| - chrome.test.callbackPass(mediaFileSystemsListCallback)); |
| - }, |
| + chrome.test.runTests([ |
| + function getGalleries() { |
| + mediaGalleries.getMediaFileSystems( |
| + chrome.test.callbackPass(mediaFileSystemsListCallback)); |
| + }, |
| - function extractEmbeddedThumbnails() { |
| - var result = mediaGalleries.extractEmbeddedThumbnails({}); |
| - chrome.test.assertEq(null, result); |
| - chrome.test.succeed(); |
| - }, |
| + function extractEmbeddedThumbnails() { |
| + var result = experimentalMediaGalleries.extractEmbeddedThumbnails({}); |
|
vandebo (ex-Chrome)
2012/07/24 04:07:05
We could test experimental APIs in a different tes
|
| + chrome.test.assertEq(null, result); |
| + chrome.test.succeed(); |
| + }, |
| - function assembleMediaFile() { |
| - mediaGalleries.assembleMediaFile( |
| - new Blob, {}, |
| - chrome.test.callbackPass(nullCallback)); |
| - }, |
| -]); |
| + function assembleMediaFile() { |
| + experimentalMediaGalleries.assembleMediaFile( |
| + new Blob, {}, |
| + chrome.test.callbackPass(nullCallback)); |
| + }, |
| + ]); |
| +}); |