| Index: chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js
|
| diff --git a/chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js b/chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..2dba1c3ecd4012bc83ff296548bc51f3c3ff6f7c
|
| --- /dev/null
|
| +++ b/chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js
|
| @@ -0,0 +1,27 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +function runTests() {
|
| + chrome.test.runTests([
|
| + function onVolumeListChanged() {
|
| + chrome.fileSystem.getVolumeList(
|
| + chrome.test.callbackPass(function(volumeList) {
|
| + chrome.test.assertEq(4, volumeList.length);
|
| +
|
| + // Confirm that adding a newly mounted volume emits an event, and
|
| + // that the volume list is updated.
|
| + chrome.fileSystem.onVolumeListChanged.addListener(
|
| + chrome.test.callbackPass(function(event) {
|
| + chrome.test.assertEq(5, event.volumes.length);
|
| + chrome.fileSystem.getVolumeList(
|
| + chrome.test.callbackPass(function(volumeList) {
|
| + chrome.test.assertEq(5, volumeList.length);
|
| + }));
|
| + }));
|
| + }));
|
| + }
|
| + ]);
|
| +}
|
| +
|
| +chrome.app.runtime.onLaunched.addListener(runTests);
|
|
|