Skip to content

Commit

Permalink
Revert "Expose stable_device_id in audio extension apis."
Browse files Browse the repository at this point in the history
This reverts commit 2ae95ec.

Revert "Initialize stable_device_id for fake devices created by FakeCrasAudioClient::Init()"

This reverts commit adbc6b1.

BUG=308143
TBR=rkc

Review URL: https://codereview.chromium.org/1760083002 .

Cr-Commit-Position: refs/branch-heads/2661@{crosswalk-project#58}
Cr-Branched-From: ef6f6ae-refs/heads/master@{#378081}
  • Loading branch information
Jenny Zhang committed Mar 3, 2016
1 parent fa07948 commit 8850b24
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 19 deletions.
18 changes: 6 additions & 12 deletions extensions/browser/api/audio/audio_apitest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,15 @@ using chromeos::AudioNode;
using chromeos::AudioNodeList;

const uint64_t kJabraSpeaker1Id = 30001;
const uint64_t kJabraSpeaker1StableDeviceId = 80001;
const uint64_t kJabraSpeaker2Id = 30002;
const uint64_t kJabraSpeaker2StableDeviceId = 80002;
const uint64_t kHDMIOutputId = 30003;
const uint64_t kHDMIOutputStabeDevicelId = 80003;
const uint64_t kJabraMic1Id = 40001;
const uint64_t kJabraMic1StableDeviceId = 90001;
const uint64_t kJabraMic2Id = 40002;
const uint64_t kJabraMic2StableDeviceId = 90002;
const uint64_t kWebcamMicId = 40003;
const uint64_t kWebcamMicStableDeviceId = 90003;

const AudioNode kJabraSpeaker1(false,
kJabraSpeaker1Id,
kJabraSpeaker1StableDeviceId,
kJabraSpeaker1Id,
"Jabra Speaker",
"USB",
"Jabra Speaker 1",
Expand All @@ -48,7 +42,7 @@ const AudioNode kJabraSpeaker1(false,

const AudioNode kJabraSpeaker2(false,
kJabraSpeaker2Id,
kJabraSpeaker2StableDeviceId,
kJabraSpeaker2Id,
"Jabra Speaker",
"USB",
"Jabra Speaker 2",
Expand All @@ -57,7 +51,7 @@ const AudioNode kJabraSpeaker2(false,

const AudioNode kHDMIOutput(false,
kHDMIOutputId,
kHDMIOutputStabeDevicelId,
kHDMIOutputId,
"HDMI output",
"HDMI",
"HDA Intel MID",
Expand All @@ -66,7 +60,7 @@ const AudioNode kHDMIOutput(false,

const AudioNode kJabraMic1(true,
kJabraMic1Id,
kJabraMic1StableDeviceId,
kJabraMic1Id,
"Jabra Mic",
"USB",
"Jabra Mic 1",
Expand All @@ -75,7 +69,7 @@ const AudioNode kJabraMic1(true,

const AudioNode kJabraMic2(true,
kJabraMic2Id,
kJabraMic2StableDeviceId,
kJabraMic2Id,
"Jabra Mic",
"USB",
"Jabra Mic 2",
Expand All @@ -84,7 +78,7 @@ const AudioNode kJabraMic2(true,

const AudioNode kUSBCameraMic(true,
kWebcamMicId,
kWebcamMicStableDeviceId,
kWebcamMicId,
"Webcam Mic",
"USB",
"Logitech Webcam",
Expand Down
4 changes: 2 additions & 2 deletions extensions/browser/api/audio/audio_service_chromeos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ void AudioServiceImpl::NotifyDevicesChanged() {
? cras_audio_handler_->GetOutputVolumePercentForDevice(
devices[i].id)
: cras_audio_handler_->GetInputGainPercentForDevice(devices[i].id);
info->stable_device_id.reset(
new std::string(base::Uint64ToString(devices[i].stable_device_id)));
// TODO(jennyz): Set stable_device_id once it is implemented.
// See crbug.com/466768.

devices_info_list.push_back(info);
}
Expand Down
3 changes: 0 additions & 3 deletions extensions/test/data/api_test/audio/add_nodes/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
chrome.audio.OnDevicesChanged.addListener(function (devices) {
if (devices.length === 3) {
if (devices[0].id != "30001" ||
devices[0].stableDeviceId != "80001" ||
devices[0].isInput != false ||
devices[0].deviceType != "USB" ||
devices[0].deviceName != "Jabra Speaker" ||
Expand All @@ -15,7 +14,6 @@ chrome.audio.OnDevicesChanged.addListener(function (devices) {
chrome.test.sendMessage("failure");
}
if (devices[1].id != "30002" ||
devices[1].stableDeviceId != "80002" ||
devices[1].isInput != false ||
devices[1].deviceType != "USB" ||
devices[1].deviceName != "Jabra Speaker" ||
Expand All @@ -25,7 +23,6 @@ chrome.audio.OnDevicesChanged.addListener(function (devices) {
chrome.test.sendMessage("failure");
}
if (devices[2].id != "30003" ||
devices[2].stableDeviceId != "80003" ||
devices[2].isInput != false ||
devices[2].deviceType != "HDMI" ||
devices[2].deviceName != "HDMI output" ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
chrome.audio.OnDevicesChanged.addListener(function (devices) {
if (devices.length === 2) {
if (devices[0].id != "40001" ||
devices[0].stableDeviceId != "90001" ||
devices[0].isInput != true ||
devices[0].deviceType != "USB" ||
devices[0].deviceName != "Jabra Mic" ||
Expand All @@ -15,7 +14,6 @@ chrome.audio.OnDevicesChanged.addListener(function (devices) {
chrome.test.sendMessage("failure");
}
if (devices[1].id != "40002" ||
devices[1].stableDeviceId != "90002" ||
devices[1].isInput != true ||
devices[1].deviceType != "USB" ||
devices[1].deviceName != "Jabra Mic" ||
Expand Down

0 comments on commit 8850b24

Please sign in to comment.