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

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

Issue 1002323002: Fixing memory error in ChromeWhispernetClientTest (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 a043ea4820a04700cbdd0365764e983710eade6b..4aa9b832abddb1d06d38b588183c88cfd4e08297 100644
--- a/chrome/browser/copresence/chrome_whispernet_client_browsertest.cc
+++ b/chrome/browser/copresence/chrome_whispernet_client_browsertest.cc
@@ -205,11 +205,21 @@ class ChromeWhispernetClientTest : public ExtensionBrowserTest,
// AudioConverter::InputCallback overrides:
double ProvideInput(media::AudioBus* dest,
base::TimeDelta /* buffer_delay */) override {
- int remaining_frames = saved_samples_->frames() - saved_samples_index_;
- int frames_to_copy = std::min(remaining_frames, dest->frames());
+ // Copy any saved samples we have to the output bus.
+ const int remaining_frames =
+ saved_samples_->frames() - saved_samples_index_;
+ const int frames_to_copy = std::min(remaining_frames, dest->frames());
saved_samples_stereo_->CopyPartialFramesTo(saved_samples_index_,
frames_to_copy, 0, dest);
saved_samples_index_ += frames_to_copy;
+
+ // Pad any remaining space with zeroes.
+ for (int i = remaining_frames; i < dest->frames(); i++) {
DaleCurtis 2015/03/18 16:52:23 Should really be dest->ZeroPartialFrames() instead
+ for (int c = 0; c < dest->channels(); c++)
+ dest->channel(c)[i] = 0;
+ }
+
+ // Return the volume level.
return 1.0;
}
@@ -232,23 +242,25 @@ class ChromeWhispernetClientTest : public ExtensionBrowserTest,
};
// These tests are irrelevant if NACL is disabled. See crbug.com/449198.
-// TODO(crbug/464120): There is also a problem in Windows debug mode.
-// TODO(crbug/464843): There is also a problem under MSan.
-#if defined(DISABLE_NACL) || \
- (!defined(NDEBUG) && defined(OS_WIN)) || \
Lei Zhang 2015/03/13 23:32:23 I'm not familiar with this issue, but if you are s
Charlie 2015/03/13 23:49:26 Yes, the windows debug bots are passing after this
- defined(MEMORY_SANITIZER)
+#if defined(DISABLE_NACL)
#define MAYBE_Initialize DISABLED_Initialize
#define MAYBE_EncodeAndDecode DISABLED_EncodeAndDecode
#define MAYBE_TokenLengths DISABLED_TokenLengths
#define MAYBE_Crc DISABLED_Crc
#define MAYBE_Parity DISABLED_Parity
-#define MAYBE_MultipleClients DISABLED_MultipleClients
#else
#define MAYBE_Initialize Initialize
#define MAYBE_EncodeAndDecode EncodeAndDecode
#define MAYBE_TokenLengths TokenLengths
#define MAYBE_Crc Crc
#define MAYBE_Parity Parity
+#endif
+
+// This test trips up ASAN on ChromeOS. See:
+// https://code.google.com/p/address-sanitizer/issues/detail?id=189
+#if defined(DISABLE_NACL) || defined(OS_CHROMEOS)
+#define MAYBE_MultipleClients DISABLED_MultipleClients
+#else
#define MAYBE_MultipleClients MultipleClients
#endif
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698