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

Side by Side Diff: chrome/browser/copresence/chrome_whispernet_client_browsertest.cc

Issue 461803003: Stop playing/recording when not needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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 | « no previous file | chrome/browser/extensions/api/copresence_private/copresence_private_api.cc » ('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 "chrome/browser/copresence/chrome_whispernet_client.h" 5 #include "chrome/browser/copresence/chrome_whispernet_client.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 const std::string& token, 130 const std::string& token,
131 bool audible, 131 bool audible,
132 const scoped_refptr<media::AudioBusRefCounted>& samples) { 132 const scoped_refptr<media::AudioBusRefCounted>& samples) {
133 EXPECT_EQ(expected_token_, token); 133 EXPECT_EQ(expected_token_, token);
134 EXPECT_EQ(expected_audible_, audible); 134 EXPECT_EQ(expected_audible_, audible);
135 saved_samples_ = samples; 135 saved_samples_ = samples;
136 ASSERT_TRUE(run_loop_); 136 ASSERT_TRUE(run_loop_);
137 run_loop_->Quit(); 137 run_loop_->Quit();
138 } 138 }
139 139
140 void TokensCallback(const std::vector<copresence::FullToken>& tokens) { 140 void TokensCallback(const std::vector<copresence::AudioToken>& tokens) {
141 ASSERT_TRUE(run_loop_); 141 ASSERT_TRUE(run_loop_);
142 run_loop_->Quit(); 142 run_loop_->Quit();
143 143
144 EXPECT_EQ(expected_token_, tokens[0].token); 144 EXPECT_EQ(expected_token_, tokens[0].token);
145 EXPECT_EQ(expected_audible_, tokens[0].audible); 145 EXPECT_EQ(expected_audible_, tokens[0].audible);
146 } 146 }
147 147
148 void DetectBroadcastCallback(bool success) { 148 void DetectBroadcastCallback(bool success) {
149 EXPECT_TRUE(success); 149 EXPECT_TRUE(success);
150 ASSERT_TRUE(run_loop_); 150 ASSERT_TRUE(run_loop_);
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 EncodeTokenAndSaveSamples(false); 184 EncodeTokenAndSaveSamples(false);
185 DecodeSamplesAndVerifyToken(false); 185 DecodeSamplesAndVerifyToken(false);
186 DetectBroadcast(); 186 DetectBroadcast();
187 } 187 }
188 188
189 IN_PROC_BROWSER_TEST_F(ChromeWhispernetClientTest, Audible) { 189 IN_PROC_BROWSER_TEST_F(ChromeWhispernetClientTest, Audible) {
190 InitializeWhispernet(); 190 InitializeWhispernet();
191 EncodeTokenAndSaveSamples(true); 191 EncodeTokenAndSaveSamples(true);
192 DecodeSamplesAndVerifyToken(true); 192 DecodeSamplesAndVerifyToken(true);
193 } 193 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/api/copresence_private/copresence_private_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698