forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented chrome.bluetooth.getProfiles().
BUG=229636 Review URL: https://chromiumcodereview.appspot.com/14472013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196756 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
youngki@chromium.org
committed
Apr 26, 2013
1 parent
47b5e68
commit 6d3882c
Showing
6 changed files
with
106 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
chrome/test/data/extensions/api_test/bluetooth/get_profiles/manifest.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Test the Bluetooth getProfiles API", | ||
"version": "1.0", | ||
"app": { | ||
"background": { | ||
"scripts": ["runtest.js"] | ||
} | ||
}, | ||
"permissions": ["bluetooth"] | ||
} |
36 changes: 36 additions & 0 deletions
36
chrome/test/data/extensions/api_test/bluetooth/get_profiles/runtest.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright 2013 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 testGetProfiles() { | ||
chrome.test.assertEq(2, profiles.length); | ||
chrome.test.assertEq('1234', profiles[0].uuid); | ||
chrome.test.assertEq('5678', profiles[1].uuid); | ||
chrome.test.succeed(); | ||
} | ||
|
||
var profiles = []; | ||
|
||
function failOnError() { | ||
if (chrome.runtime.lastError) { | ||
chrome.test.fail(chrome.runtime.lastError.message); | ||
} | ||
} | ||
|
||
chrome.bluetooth.getProfiles( | ||
{ | ||
device: { | ||
name: 'device', | ||
address: '11:12:13:14:15:16', | ||
paired: false, | ||
connected: false | ||
} | ||
}, | ||
function(results) { | ||
failOnError(); | ||
profiles = results; | ||
chrome.test.sendMessage('ready', | ||
function(message) { | ||
chrome.test.runTests([testGetProfiles]); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters