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

Unified Diff: chrome/browser/copresence/chrome_whispernet_client_browsertest.cc

Issue 865483005: Creating the audio_modem component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merging again Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/copresence/chrome_whispernet_client_browsertest.cc
diff --git a/chrome/browser/copresence/chrome_whispernet_client_browsertest.cc b/chrome/browser/copresence/chrome_whispernet_client_browsertest.cc
index 2cc2cd4218ef91574b6888a7a2a526ccd0e42590..5c1f5b885ee968a4aecea6fe0c89fce4c820b62c 100644
--- a/chrome/browser/copresence/chrome_whispernet_client_browsertest.cc
+++ b/chrome/browser/copresence/chrome_whispernet_client_browsertest.cc
@@ -17,9 +17,13 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/test/base/in_process_browser_test.h"
-#include "components/copresence/public/copresence_constants.h"
+#include "components/audio_modem/public/whispernet_client.h"
#include "media/base/audio_bus.h"
+using audio_modem::WhispernetClient;
+using audio_modem::AUDIBLE;
+using audio_modem::INAUDIBLE;
+
namespace {
// TODO(rkc): Add more varied test input.
@@ -29,8 +33,7 @@ const char kNineZeros[] = "MDAwMDAwMDAw";
const size_t kTokenLengths[] = {6, 6};
-copresence::WhispernetClient* GetWhispernetClient(
- content::BrowserContext* context) {
+WhispernetClient* GetWhispernetClient(content::BrowserContext* context) {
extensions::CopresenceService* service =
extensions::CopresenceService::GetFactoryInstance()->Get(context);
return service ? service->whispernet_client() : NULL;
@@ -71,17 +74,17 @@ class ChromeWhispernetClientTest : public ExtensionBrowserTest {
}
void EncodeTokenAndSaveSamples(bool audible, const std::string& token) {
- copresence::WhispernetClient* client = GetWhispernetClient(context_);
+ WhispernetClient* client = GetWhispernetClient(context_);
ASSERT_TRUE(client);
run_loop_.reset(new base::RunLoop());
- client->RegisterSamplesCallback(base::Bind(
- &ChromeWhispernetClientTest::SamplesCallback, base::Unretained(this)));
+ client->RegisterSamplesCallback(
+ base::Bind(&ChromeWhispernetClientTest::SamplesCallback,
+ base::Unretained(this)));
expected_token_ = token;
expected_audible_ = audible;
- client->EncodeToken(token,
- audible ? copresence::AUDIBLE : copresence::INAUDIBLE);
+ client->EncodeToken(token, audible ? AUDIBLE : INAUDIBLE);
run_loop_->Run();
EXPECT_GT(saved_samples_->frames(), 0);
@@ -90,7 +93,7 @@ class ChromeWhispernetClientTest : public ExtensionBrowserTest {
void DecodeSamplesAndVerifyToken(bool expect_audible,
const std::string& expected_token,
const size_t token_length[2]) {
- copresence::WhispernetClient* client = GetWhispernetClient(context_);
+ WhispernetClient* client = GetWhispernetClient(context_);
ASSERT_TRUE(client);
run_loop_.reset(new base::RunLoop());
@@ -113,13 +116,13 @@ class ChromeWhispernetClientTest : public ExtensionBrowserTest {
sizeof(float) * saved_samples_->frames());
client->DecodeSamples(
- expect_audible ? copresence::AUDIBLE : copresence::INAUDIBLE,
+ expect_audible ? AUDIBLE : INAUDIBLE,
AudioBusToString(samples_bus), token_length);
run_loop_->Run();
}
void DetectBroadcast() {
- copresence::WhispernetClient* client = GetWhispernetClient(context_);
+ WhispernetClient* client = GetWhispernetClient(context_);
ASSERT_TRUE(client);
run_loop_.reset(new base::RunLoop());
@@ -138,17 +141,17 @@ class ChromeWhispernetClientTest : public ExtensionBrowserTest {
}
void SamplesCallback(
- copresence::AudioType type,
+ audio_modem::AudioType type,
const std::string& token,
const scoped_refptr<media::AudioBusRefCounted>& samples) {
EXPECT_EQ(expected_token_, token);
- EXPECT_EQ(expected_audible_, type == copresence::AUDIBLE);
+ EXPECT_EQ(expected_audible_, type == AUDIBLE);
saved_samples_ = samples;
ASSERT_TRUE(run_loop_);
run_loop_->Quit();
}
- void TokensCallback(const std::vector<copresence::AudioToken>& tokens) {
+ void TokensCallback(const std::vector<audio_modem::AudioToken>& tokens) {
ASSERT_TRUE(run_loop_);
run_loop_->Quit();
« no previous file with comments | « chrome/browser/copresence/chrome_whispernet_client.cc ('k') | chrome/browser/copresence/chrome_whispernet_config.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698