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

Side by Side Diff: content/child/indexed_db/indexed_db_dispatcher_unittest.cc

Issue 621683003: Fix unit test memory leaks following blink r183043 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop/message_loop_proxy.h" 6 #include "base/message_loop/message_loop_proxy.h"
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "content/child/indexed_db/indexed_db_dispatcher.h" 8 #include "content/child/indexed_db/indexed_db_dispatcher.h"
9 #include "content/child/indexed_db/webidbcursor_impl.h" 9 #include "content/child/indexed_db/webidbcursor_impl.h"
10 #include "content/child/thread_safe_sender.h" 10 #include "content/child/thread_safe_sender.h"
11 #include "content/common/indexed_db/indexed_db_key.h" 11 #include "content/common/indexed_db/indexed_db_key.h"
12 #include "content/common/indexed_db/indexed_db_key_range.h" 12 #include "content/common/indexed_db/indexed_db_key_range.h"
13 #include "content/common/indexed_db/indexed_db_messages.h" 13 #include "content/common/indexed_db/indexed_db_messages.h"
14 #include "ipc/ipc_sync_message_filter.h" 14 #include "ipc/ipc_sync_message_filter.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 #include "third_party/WebKit/public/platform/WebBlobInfo.h" 16 #include "third_party/WebKit/public/platform/WebBlobInfo.h"
17 #include "third_party/WebKit/public/platform/WebData.h" 17 #include "third_party/WebKit/public/platform/WebData.h"
18 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h" 18 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h"
19 #include "third_party/WebKit/public/web/WebHeap.h"
19 20
20 using blink::WebBlobInfo; 21 using blink::WebBlobInfo;
21 using blink::WebData; 22 using blink::WebData;
22 using blink::WebIDBCallbacks; 23 using blink::WebIDBCallbacks;
23 using blink::WebIDBCursor; 24 using blink::WebIDBCursor;
24 using blink::WebIDBDatabase; 25 using blink::WebIDBDatabase;
25 using blink::WebIDBDatabaseError; 26 using blink::WebIDBDatabaseError;
26 using blink::WebIDBKey; 27 using blink::WebIDBKey;
27 using blink::WebVector; 28 using blink::WebVector;
28 29
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 } // namespace 61 } // namespace
61 62
62 class IndexedDBDispatcherTest : public testing::Test { 63 class IndexedDBDispatcherTest : public testing::Test {
63 public: 64 public:
64 IndexedDBDispatcherTest() 65 IndexedDBDispatcherTest()
65 : message_loop_proxy_(base::MessageLoopProxy::current()), 66 : message_loop_proxy_(base::MessageLoopProxy::current()),
66 sync_message_filter_(new IPC::SyncMessageFilter(NULL)), 67 sync_message_filter_(new IPC::SyncMessageFilter(NULL)),
67 thread_safe_sender_(new ThreadSafeSender(message_loop_proxy_.get(), 68 thread_safe_sender_(new ThreadSafeSender(message_loop_proxy_.get(),
68 sync_message_filter_.get())) {} 69 sync_message_filter_.get())) {}
69 70
71 virtual void TearDown() OVERRIDE {
cmumford 2014/10/01 17:22:35 In light of http://chromium-cpp.appspot.com/ shoul
jsbell 2014/10/01 17:24:56 Sure - done.
72 blink::WebHeap::collectAllGarbageForTesting();
73 }
74
70 protected: 75 protected:
71 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_; 76 scoped_refptr<base::MessageLoopProxy> message_loop_proxy_;
72 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_; 77 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;
73 scoped_refptr<ThreadSafeSender> thread_safe_sender_; 78 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
74 79
75 private: 80 private:
76 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcherTest); 81 DISALLOW_COPY_AND_ASSIGN(IndexedDBDispatcherTest);
77 }; 82 };
78 83
79 TEST_F(IndexedDBDispatcherTest, ValueSizeTest) { 84 TEST_F(IndexedDBDispatcherTest, ValueSizeTest) {
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 cursor1_transaction_id); 342 cursor1_transaction_id);
338 343
339 EXPECT_EQ(2, cursor1->reset_count()); 344 EXPECT_EQ(2, cursor1->reset_count());
340 EXPECT_EQ(0, cursor2->reset_count()); 345 EXPECT_EQ(0, cursor2->reset_count());
341 346
342 cursor1.reset(); 347 cursor1.reset();
343 cursor2.reset(); 348 cursor2.reset();
344 } 349 }
345 350
346 } // namespace content 351 } // namespace content
OLDNEW
« 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