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

Unified Diff: chrome/test/data/extensions/api_test/file_system/on_volume_list_changed/background.js

Issue 1135383002: Add the chrome.fileSystem.onVolumeListChanged event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleaned up. Created 5 years, 7 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
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);

Powered by Google App Engine
This is Rietveld 408576698