1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // system.storage api test
6 // extensions_browsertests --gtest_filter=SystemStorageApiTest.Storage
8 // Testing data should be the same as |kRemovableStorageData| in
9 // test_storage_info_provider.cc.
19 chrome.test.runTests([
20 function testAttachedEvent() {
21 chrome.test.listenOnce(
22 chrome.system.storage.onAttached,
23 function listener(info) {
24 // Record the transient id.
26 chrome.test.assertEq(testData.name, info.name);
27 chrome.test.assertEq(testData.type, info.type);
28 chrome.test.assertEq(testData.capacity, info.capacity);
32 // Tell browser process to attach a new removable storage.
33 chrome.test.sendMessage("attach");
36 function testDetachedEvent() {
37 chrome.test.listenOnce(
38 chrome.system.storage.onDetached,
39 function listener(id) {
40 chrome.test.assertEq(device_id, id);
41 chrome.test.sendMessage(id);
44 // Tell browser process to detach a storage.
45 chrome.test.sendMessage("detach");