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

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

Issue 344653003: Revert 274608 "Implement getMediaDevices." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2057/src/
Patch Set: 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
49 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingRTCPeerConnection) { 36 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingRTCPeerConnection) {
50 MockPerSessionWebRTCAPIMetrics metrics; 37 MockPerSessionWebRTCAPIMetrics metrics;
51 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)); 38 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION));
52 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 39 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
53 } 40 }
54 41
55 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingMultiplePC) { 42 TEST(PerSessionWebRTCAPIMetrics, NoCallOngoingMultiplePC) {
56 MockPerSessionWebRTCAPIMetrics metrics; 43 MockPerSessionWebRTCAPIMetrics metrics;
57 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1); 44 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1);
58 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 45 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
(...skipping 11 matching lines...) Expand all
70 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 57 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
71 metrics.DecrementStreamCounter(); 58 metrics.DecrementStreamCounter();
72 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 59 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
73 metrics.DecrementStreamCounter(); 60 metrics.DecrementStreamCounter();
74 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1); 61 EXPECT_CALL(metrics, LogUsage(WEBKIT_RTC_PEER_CONNECTION)).Times(1);
75 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 62 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
76 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION); 63 metrics.LogUsageOnlyOnce(WEBKIT_RTC_PEER_CONNECTION);
77 } 64 }
78 65
79 } // namespace content 66 } // 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