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

Side by Side Diff: content/renderer/media/webrtc_uma_histograms_unittest.cc

Issue 287383002: Implement getMediaDevices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « content/renderer/media/webrtc_uma_histograms.h ('k') | tools/metrics/histograms/histograms.xml » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "content/renderer/media/webrtc_uma_histograms.h" 5 #include "content/renderer/media/webrtc_uma_histograms.h"
6 6
7 #include "testing/gmock/include/gmock/gmock.h" 7 #include "testing/gmock/include/gmock/gmock.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 using ::testing::_; 10 using ::testing::_;
(...skipping 15 matching lines...) Expand all
26 metrics.LogUsageOnlyOnce(WEBKIT_GET_USER_MEDIA); 26 metrics.LogUsageOnlyOnce(WEBKIT_GET_USER_MEDIA);
27 } 27 }
28 28
29 TEST(PerSessionWebRTCAPIMetrics, CallOngoingGetUserMedia) { 29 TEST(PerSessionWebRTCAPIMetrics, CallOngoingGetUserMedia) {
30 MockPerSessionWebRTCAPIMetrics metrics; 30 MockPerSessionWebRTCAPIMetrics metrics;
31 metrics.IncrementStreamCounter(); 31 metrics.IncrementStreamCounter();
32 EXPECT_CALL(metrics, LogUsage(WEBKIT_GET_USER_MEDIA)).Times(1); 32 EXPECT_CALL(metrics, LogUsage(WEBKIT_GET_USER_MEDIA)).Times(1);
33 metrics.LogUsageOnlyOnce(WEBKIT_GET_USER_MEDIA); 33 metrics.LogUsageOnlyOnce(WEBKIT_GET_USER_MEDIA);
34 } 34 }
35 35
36 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingGetMediaDevices) {
37 MockPerSessionWebRTCAPIMetrics metrics;
38 EXPECT_CALL(metrics, LogUsage(_)).Times(1);
39 metrics.LogUsageOnlyOnce(WEBKIT_GET_MEDIA_DEVICES);
40 }
41
42 TEST(PerSessionWebRTCAPIMetrics, CallOngoingGetMediaDevices) {
43 MockPerSessionWebRTCAPIMetrics metrics;
44 metrics.IncrementStreamCounter();
45 EXPECT_CALL(metrics, LogUsage(WEBKIT_GET_MEDIA_DEVICES)).Times(1);
46 metrics.LogUsageOnlyOnce(WEBKIT_GET_MEDIA_DEVICES);
47 }
48
36 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingRTCPeerConnection) { 49 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingRTCPeerConnection) {
37 MockPerSessionWebRTCAPIMetrics metrics; 50 MockPerSessionWebRTCAPIMetrics metrics;
38 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)); 51 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION));
39 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 52 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
40 } 53 }
41 54
42 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingMultiplePC) { 55 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingMultiplePC) {
43 MockPerSessionWebRTCAPIMetrics metrics; 56 MockPerSessionWebRTCAPIMetrics metrics;
44 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1); 57 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1);
45 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 58 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
(...skipping 11 matching lines...) Expand all
57 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 70 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
58 metrics.DecrementStreamCounter(); 71 metrics.DecrementStreamCounter();
59 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 72 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
60 metrics.DecrementStreamCounter(); 73 metrics.DecrementStreamCounter();
61 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1); 74 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1);
62 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 75 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
63 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 76 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
64 } 77 }
65 78
66 } // namespace content 79 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_uma_histograms.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698