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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <cstdlib> | 10 #include <cstdlib> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/run_loop.h" | 16 #include "base/run_loop.h" |
17 #include "base/stl_util.h" | 17 #include "base/stl_util.h" |
18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
19 #include "chrome/browser/extensions/api/copresence/copresence_api.h" | 19 #include "chrome/browser/extensions/api/copresence/copresence_api.h" |
20 #include "chrome/browser/extensions/extension_browsertest.h" | 20 #include "chrome/browser/extensions/extension_browsertest.h" |
21 #include "chrome/browser/profiles/profile.h" | 21 #include "chrome/browser/profiles/profile.h" |
22 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
23 #include "chrome/test/base/in_process_browser_test.h" | 23 #include "chrome/test/base/in_process_browser_test.h" |
24 #include "components/audio_modem/public/audio_modem_types.h" | 24 #include "components/audio_modem/public/audio_modem_types.h" |
25 #include "components/audio_modem/public/whispernet_client.h" | 25 #include "components/audio_modem/public/whispernet_client.h" |
26 #include "media/audio/audio_manager.h" | 26 #include "media/audio/audio_manager.h" |
27 #include "media/audio/audio_manager_base.h" | 27 #include "media/audio/audio_manager_base.h" |
28 #include "media/audio/audio_parameters.h" | |
29 #include "media/base/audio_bus.h" | 28 #include "media/base/audio_bus.h" |
30 #include "media/base/audio_converter.h" | 29 #include "media/base/audio_converter.h" |
| 30 #include "media/base/audio_parameters.h" |
31 | 31 |
32 using audio_modem::WhispernetClient; | 32 using audio_modem::WhispernetClient; |
33 using audio_modem::AUDIBLE; | 33 using audio_modem::AUDIBLE; |
34 using audio_modem::INAUDIBLE; | 34 using audio_modem::INAUDIBLE; |
35 using audio_modem::TokenParameters; | 35 using audio_modem::TokenParameters; |
36 | 36 |
37 namespace { | 37 namespace { |
38 | 38 |
39 // TODO(ckehoe): Use randomly generated tokens instead. | 39 // TODO(ckehoe): Use randomly generated tokens instead. |
40 const char kSixZeros[] = "MDAwMDAw"; | 40 const char kSixZeros[] = "MDAwMDAw"; |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 | 366 |
367 EncodeTokenAndSaveSamples(client_3.get(), true, kSixZeros, token_params); | 367 EncodeTokenAndSaveSamples(client_3.get(), true, kSixZeros, token_params); |
368 DecodeSamplesAndVerifyToken(client_3.get(), true, kSixZeros, token_params); | 368 DecodeSamplesAndVerifyToken(client_3.get(), true, kSixZeros, token_params); |
369 | 369 |
370 const size_t kLongTokenLengths[2] = {8, 9}; | 370 const size_t kLongTokenLengths[2] = {8, 9}; |
371 GetTokenParamsForLengths(kLongTokenLengths, token_params); | 371 GetTokenParamsForLengths(kLongTokenLengths, token_params); |
372 | 372 |
373 EncodeTokenAndSaveSamples(client_2.get(), true, kEightZeros, token_params); | 373 EncodeTokenAndSaveSamples(client_2.get(), true, kEightZeros, token_params); |
374 DecodeSamplesAndVerifyToken(client_2.get(), true, kEightZeros, token_params); | 374 DecodeSamplesAndVerifyToken(client_2.get(), true, kEightZeros, token_params); |
375 } | 375 } |
OLD | NEW |