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

Side by Side Diff: chrome/test/data/extensions/api_test/systeminfo/storage_eject/test.js

Issue 18578008: [SystemInfo API] Move Storage API out of experimental namespace and rename to the "system" namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix PermissionTest unittest. Created 7 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
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.
4
5 var attachedDeviceId;
6
7 systemInfo = chrome.experimental.systemInfo;
8
9 function testAttach(details) {
10 attachedDeviceId = details.id;
11 chrome.test.sendMessage('attach_test_ok,' + details.name);
12 };
13
14 function ejectCallback(result) {
15 if (result == "success") {
16 chrome.test.sendMessage("eject_ok");
17 } else if (result == "in_use") {
18 chrome.test.sendMessage("eject_in_use");
19 } else if (result == "no_such_device") {
20 chrome.test.sendMessage("eject_no_such_device");
21 } else {
22 chrome.test.sendMessage("eject_failure");
23 }
24 };
25
26 function ejectTest() {
27 systemInfo.storage.ejectDevice(attachedDeviceId, ejectCallback);
28 };
29
30 function addAttachListener() {
31 systemInfo.storage.onAttached.addListener(testAttach);
32 chrome.test.sendMessage('add_attach_ok');
33 };
34
35 function removeAttachListener() {
36 systemInfo.storage.onAttached.removeListener(testAttach);
37 chrome.test.sendMessage('remove_attach_ok');
38 };
39
40 function ejectFailTest() {
41 systemInfo.storage.ejectDevice('-1', ejectCallback);
42 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698