New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 598800 link

Starred by 2 users

Issue metadata

Status: Verified
Owner:
Last visit > 30 days ago
Closed: Apr 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

cras_audio_client.cc needs unittest

Project Member Reported by warx@chromium.org, Mar 29 2016

Issue description

cras_audio_client.cc needs unittest
 

Comment 1 by warx@chromium.org, Mar 29 2016

Labels: -Pri-3 Pri-2

Comment 3 by warx@chromium.org, Apr 7 2016

Owner: warx@chromium.org

Comment 4 by warx@chromium.org, Apr 8 2016

Cc: steve...@chromium.org
Labels: OS-Chrome
Status: Started (was: Untriaged)

Comment 5 by warx@chromium.org, Apr 8 2016

Cc: hashimoto@chromium.org
About implementation, I see I can reuse most of the code in shill_client_unittest_base. I would like to know if I should 
(1) subclass shill_client_unittest_base for cras_audio_client_unittest, which doesn't fit "subclass" definition.
(2) create a new one cras_audio_client_unittest_base, write what are needed for cras_audio_client
(3) instead of (2), all in cras_audio_client_unittest, this will cause a bit long source file
(4) create a new general one, like dbus_client_unittest_base

which code change ways are preferred?
If you think it makes sense, you can extract needed parts from shill_client_unittest_base as some kind of utility, and you can use it from the unit test of cras audio.

Comment 7 by warx@chromium.org, Apr 13 2016

major part of cras_audio_client_unittest.cc review link: https://codereview.chromium.org/1885763004/
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 14 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c9b2849b11b322f770d1f3aaed2769fdfdcf545c

commit c9b2849b11b322f770d1f3aaed2769fdfdcf545c
Author: warx <warx@chromium.org>
Date: Thu Apr 14 18:27:20 2016

Major part of CrasAudioClientUnittest

Currently done:
(1) signal monitoring test
OutputMuteChanged, InputMuteChanged, NodesChanged, ActiveOutputNodeChanged, ActiveInputNodeChanged.

(2) client API test
GetVolumeState, GetNodes, SetGlobalOutputChannelRemix.

Remaining tests are pretty much the same as the above. Will do it on a separate CL.

Existing warnings:
each test case has the following Warning:
GMOCK WARNING:
Uninteresting mock function call - returning directly.
    Function call: AssertOnOriginThread()
NOTE: You can safely ignore the above warning unless this call should not happen.  Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call.  See http://code.google.com/p/googlemock/wiki/CookBook#Knowing_When_to_Expect for details.

BUG= 598800 

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

Cr-Commit-Position: refs/heads/master@{#387372}

[modify] https://crrev.com/c9b2849b11b322f770d1f3aaed2769fdfdcf545c/chromeos/chromeos.gyp
[modify] https://crrev.com/c9b2849b11b322f770d1f3aaed2769fdfdcf545c/chromeos/dbus/cras_audio_client.h
[add] https://crrev.com/c9b2849b11b322f770d1f3aaed2769fdfdcf545c/chromeos/dbus/cras_audio_client_unittest.cc

Project Member

Comment 9 by bugdroid1@chromium.org, Apr 15 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/d587bb4ffd6c3ecbb4a7929c9bab0fed448f1c62

commit d587bb4ffd6c3ecbb4a7929c9bab0fed448f1c62
Author: warx <warx@chromium.org>
Date: Fri Apr 15 19:02:54 2016

Finishing cras audio client unittest

Combined with https://codereview.chromium.org/1885763004/

Testing on all method call of dbus APIs under cras::kCrasControlInterface, except GetVolumeState, which expects phasing out.

BUG= 598800 

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

Cr-Commit-Position: refs/heads/master@{#387667}

[modify] https://crrev.com/d587bb4ffd6c3ecbb4a7929c9bab0fed448f1c62/chromeos/dbus/cras_audio_client_unittest.cc

Comment 10 by warx@chromium.org, Apr 15 2016

Status: Fixed (was: Started)
Status: Verified (was: Fixed)
Bulk verified

Sign in to add a comment