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

Side by Side Diff: webkit/glue/media/buffered_data_source_unittest.cc

Issue 2825059: Fix an unitialized read in a unit test to appease valgrind (Closed)
Patch Set: fix problem instead of suppressing it Created 10 years, 5 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
« no previous file with comments | « webkit/glue/media/buffered_data_source.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "media/base/filters.h" 10 #include "media/base/filters.h"
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 504
505 EXPECT_CALL(*this, ReadCallback(net::ERR_CACHE_MISS)); 505 EXPECT_CALL(*this, ReadCallback(net::ERR_CACHE_MISS));
506 ReadLoader(20, 5, buffer); 506 ReadLoader(20, 5, buffer);
507 StopWhenLoad(); 507 StopWhenLoad();
508 } 508 }
509 509
510 // TODO(hclam): add unit test for defer loading. 510 // TODO(hclam): add unit test for defer loading.
511 511
512 class MockBufferedResourceLoader : public BufferedResourceLoader { 512 class MockBufferedResourceLoader : public BufferedResourceLoader {
513 public: 513 public:
514 MockBufferedResourceLoader() : BufferedResourceLoader() { 514 MockBufferedResourceLoader() : BufferedResourceLoader(NULL, GURL(), 0, 0) {
515 } 515 }
516 516
517 MOCK_METHOD2(Start, void(net::CompletionCallback* read_callback, 517 MOCK_METHOD2(Start, void(net::CompletionCallback* read_callback,
518 NetworkEventCallback* network_callback)); 518 NetworkEventCallback* network_callback));
519 MOCK_METHOD0(Stop, void()); 519 MOCK_METHOD0(Stop, void());
520 MOCK_METHOD4(Read, void(int64 position, int read_size, uint8* buffer, 520 MOCK_METHOD4(Read, void(int64 position, int read_size, uint8* buffer,
521 net::CompletionCallback* callback)); 521 net::CompletionCallback* callback));
522 MOCK_METHOD0(content_length, int64()); 522 MOCK_METHOD0(content_length, int64());
523 MOCK_METHOD0(instance_size, int64()); 523 MOCK_METHOD0(instance_size, int64());
524 MOCK_METHOD0(partial_response, bool()); 524 MOCK_METHOD0(partial_response, bool());
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 StopDataSource(); 925 StopDataSource();
926 } 926 }
927 927
928 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { 928 TEST_F(BufferedDataSourceTest, FileHasLoadedState) {
929 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); 929 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED);
930 ReadDataSourceTimesOut(20, 10); 930 ReadDataSourceTimesOut(20, 10);
931 StopDataSource(); 931 StopDataSource();
932 } 932 }
933 933
934 } // namespace webkit_glue 934 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/media/buffered_data_source.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698