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

Side by Side Diff: webkit/glue/media/simple_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
« no previous file with comments | « webkit/glue/media/buffered_resource_loader_unittest.cc ('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) 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 "media/base/filters.h" 5 #include "media/base/filters.h"
6 #include "media/base/mock_callback.h" 6 #include "media/base/mock_callback.h"
7 #include "media/base/mock_filter_host.h" 7 #include "media/base/mock_filter_host.h"
8 #include "media/base/mock_filters.h" 8 #include "media/base/mock_filters.h"
9 #include "net/base/net_errors.h" 9 #include "net/base/net_errors.h"
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 class SimpleDataSourceTest : public testing::Test { 50 class SimpleDataSourceTest : public testing::Test {
51 public: 51 public:
52 SimpleDataSourceTest() { 52 SimpleDataSourceTest() {
53 for (int i = 0; i < kDataSize; ++i) { 53 for (int i = 0; i < kDataSize; ++i) {
54 data_[i] = i; 54 data_[i] = i;
55 } 55 }
56 } 56 }
57 57
58 virtual ~SimpleDataSourceTest() { 58 virtual ~SimpleDataSourceTest() {
59 ignore_result(frame_.release());
60 } 59 }
61 60
62 void InitializeDataSource(const char* url, 61 void InitializeDataSource(const char* url,
63 media::MockCallback* callback) { 62 media::MockCallback* callback) {
64 gurl_ = GURL(url); 63 gurl_ = GURL(url);
65 64
66 frame_.reset(new NiceMock<MockWebFrame>()); 65 frame_.reset(new NiceMock<MockWebFrame>());
67 url_loader_ = new NiceMock<MockWebURLLoader>(); 66 url_loader_ = new NiceMock<MockWebURLLoader>();
68 67
69 data_source_ = new SimpleDataSource(MessageLoop::current(), 68 data_source_ = new SimpleDataSource(MessageLoop::current(),
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 } 207 }
209 208
210 TEST_F(SimpleDataSourceTest, AsyncRead) { 209 TEST_F(SimpleDataSourceTest, AsyncRead) {
211 InitializeDataSource(kFileUrl, media::NewExpectedCallback()); 210 InitializeDataSource(kFileUrl, media::NewExpectedCallback());
212 RequestSucceeded(true); 211 RequestSucceeded(true);
213 AsyncRead(); 212 AsyncRead();
214 DestroyDataSource(); 213 DestroyDataSource();
215 } 214 }
216 215
217 } // namespace webkit_glue 216 } // namespace webkit_glue
OLDNEW
« no previous file with comments | « webkit/glue/media/buffered_resource_loader_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698