OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |