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

Side by Side Diff: chrome/test/data/extensions/api_test/bluetooth/on_connection/runtest.js

Issue 180163009: chrome.bluetooth API improvements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ChromeOS Full build. Created 6 years, 8 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
« no previous file with comments | « chrome/common/extensions/api/bluetooth.idl ('k') | device/bluetooth/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var deviceName; 5 var deviceName;
6 var deviceAddress; 6 var deviceAddress;
7 var profileUuid; 7 var profileUuid;
8 8
9 function testOnConnectionEvent() { 9 function testOnConnectionEvent() {
10 chrome.test.assertEq('d1', deviceName); 10 chrome.test.assertEq('d1', deviceName);
11 chrome.test.assertEq('11:12:13:14:15:16', deviceAddress); 11 chrome.test.assertEq('11:12:13:14:15:16', deviceAddress);
12 chrome.test.assertEq('00001234-0000-1000-8000-00805f9b34fb', profileUuid); 12 chrome.test.assertEq('00001234-0000-1000-8000-00805f9b34fb', profileUuid);
13 13
14 chrome.test.succeed(); 14 chrome.test.succeed();
15 } 15 }
16 16
17 chrome.bluetooth.onConnection.addListener( 17 chrome.bluetooth.onConnection.addListener(
18 function(socket) { 18 function(socket) {
19 deviceName = socket.device.name; 19 deviceName = socket.device.name;
20 deviceAddress = socket.device.address; 20 deviceAddress = socket.device.address;
21 profileUuid = socket.profile.uuid; 21 profileUuid = socket.uuid;
22 chrome.bluetooth.disconnect({'socket': socket}); 22 chrome.bluetooth.disconnect({'socketId': socket.id});
23 }); 23 });
24 24
25 chrome.test.sendMessage('ready', 25 chrome.test.sendMessage('ready',
26 function(message) { 26 function(message) {
27 chrome.test.runTests([testOnConnectionEvent]); 27 chrome.test.runTests([testOnConnectionEvent]);
28 }); 28 });
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/bluetooth.idl ('k') | device/bluetooth/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698