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

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

Issue 6246017: Fix memory leaks in BufferedDataSource, BufferedResourceLoader and SimpleDataSource unit tests. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/test/test_timeouts.h" 7 #include "base/test/test_timeouts.h"
8 #include "media/base/mock_callback.h" 8 #include "media/base/mock_callback.h"
9 #include "media/base/mock_filter_host.h" 9 #include "media/base/mock_filter_host.h"
10 #include "media/base/mock_filters.h" 10 #include "media/base/mock_filters.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 BufferedDataSourceTest() { 98 BufferedDataSourceTest() {
99 message_loop_ = MessageLoop::current(); 99 message_loop_ = MessageLoop::current();
100 100
101 // Prepare test data. 101 // Prepare test data.
102 for (size_t i = 0; i < sizeof(data_); ++i) { 102 for (size_t i = 0; i < sizeof(data_); ++i) {
103 data_[i] = i; 103 data_[i] = i;
104 } 104 }
105 } 105 }
106 106
107 virtual ~BufferedDataSourceTest() { 107 virtual ~BufferedDataSourceTest() {
108 ignore_result(frame_.release());
109 } 108 }
110 109
111 void ExpectCreateAndStartResourceLoader(int start_error) { 110 void ExpectCreateAndStartResourceLoader(int start_error) {
112 EXPECT_CALL(*data_source_, CreateResourceLoader(_, _)) 111 EXPECT_CALL(*data_source_, CreateResourceLoader(_, _))
113 .WillOnce(Return(loader_.get())); 112 .WillOnce(Return(loader_.get()));
114 113
115 EXPECT_CALL(*loader_, Start(NotNull(), NotNull(), NotNull())) 114 EXPECT_CALL(*loader_, Start(NotNull(), NotNull(), NotNull()))
116 .WillOnce( 115 .WillOnce(
117 DoAll(Assign(&error_, start_error), 116 DoAll(Assign(&error_, start_error),
118 Invoke(this, 117 Invoke(this,
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 StopDataSource(); 486 StopDataSource();
488 } 487 }
489 488
490 TEST_F(BufferedDataSourceTest, FileHasLoadedState) { 489 TEST_F(BufferedDataSourceTest, FileHasLoadedState) {
491 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED); 490 InitializeDataSource(kFileUrl, net::OK, true, 1024, LOADED);
492 ReadDataSourceTimesOut(20, 10); 491 ReadDataSourceTimesOut(20, 10);
493 StopDataSource(); 492 StopDataSource();
494 } 493 }
495 494
496 } // namespace webkit_glue 495 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « tools/valgrind/memcheck/suppressions.txt ('k') | webkit/glue/media/buffered_resource_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698