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

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

Issue 18346006: Update OS X to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 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 | Annotate | Revision Log
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/values.h" 6 #include "base/values.h"
7 #include "content/child/indexed_db/indexed_db_dispatcher.h" 7 #include "content/child/indexed_db/indexed_db_dispatcher.h"
8 #include "content/child/indexed_db/proxy_webidbcursor_impl.h" 8 #include "content/child/indexed_db/proxy_webidbcursor_impl.h"
9 #include "content/child/thread_safe_sender.h" 9 #include "content/child/thread_safe_sender.h"
10 #include "content/common/indexed_db/indexed_db_key.h" 10 #include "content/common/indexed_db/indexed_db_key.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 TEST(RendererWebIDBCursorImplTest, PrefetchTest) { 84 TEST(RendererWebIDBCursorImplTest, PrefetchTest) {
85 85
86 WebIDBKey null_key; 86 WebIDBKey null_key;
87 null_key.assignNull(); 87 null_key.assignNull();
88 88
89 scoped_refptr<base::MessageLoopProxy> message_loop_proxy( 89 scoped_refptr<base::MessageLoopProxy> message_loop_proxy(
90 base::MessageLoopProxy::current()); 90 base::MessageLoopProxy::current());
91 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter( 91 scoped_refptr<IPC::SyncMessageFilter> sync_message_filter(
92 new IPC::SyncMessageFilter(NULL)); 92 new IPC::SyncMessageFilter(NULL));
93 scoped_refptr<ThreadSafeSender> thread_safe_sender(new ThreadSafeSender( 93 scoped_refptr<ThreadSafeSender> thread_safe_sender(new ThreadSafeSender(
94 message_loop_proxy, sync_message_filter)); 94 message_loop_proxy.get(), sync_message_filter.get()));
95 95
96 MockDispatcher dispatcher(thread_safe_sender); 96 MockDispatcher dispatcher(thread_safe_sender.get());
97 97
98 { 98 {
99 RendererWebIDBCursorImpl cursor( 99 RendererWebIDBCursorImpl cursor(RendererWebIDBCursorImpl::kInvalidCursorId,
100 RendererWebIDBCursorImpl::kInvalidCursorId, thread_safe_sender); 100 thread_safe_sender.get());
101 101
102 // Call continue() until prefetching should kick in. 102 // Call continue() until prefetching should kick in.
103 int continue_calls = 0; 103 int continue_calls = 0;
104 EXPECT_EQ(dispatcher.continue_calls(), 0); 104 EXPECT_EQ(dispatcher.continue_calls(), 0);
105 for (int i = 0; i < RendererWebIDBCursorImpl::kPrefetchContinueThreshold; 105 for (int i = 0; i < RendererWebIDBCursorImpl::kPrefetchContinueThreshold;
106 ++i) { 106 ++i) {
107 cursor.continueFunction(null_key, new MockContinueCallbacks()); 107 cursor.continueFunction(null_key, new MockContinueCallbacks());
108 EXPECT_EQ(++continue_calls, dispatcher.continue_calls()); 108 EXPECT_EQ(++continue_calls, dispatcher.continue_calls());
109 EXPECT_EQ(0, dispatcher.prefetch_calls()); 109 EXPECT_EQ(0, dispatcher.prefetch_calls());
110 } 110 }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 EXPECT_EQ(expected_key++, key.number()); 152 EXPECT_EQ(expected_key++, key.number());
153 } 153 }
154 } 154 }
155 } 155 }
156 156
157 EXPECT_EQ(dispatcher.destroyed_cursor_id(), 157 EXPECT_EQ(dispatcher.destroyed_cursor_id(),
158 RendererWebIDBCursorImpl::kInvalidCursorId); 158 RendererWebIDBCursorImpl::kInvalidCursorId);
159 } 159 }
160 160
161 } // namespace content 161 } // namespace content
OLDNEW
« no previous file with comments | « content/child/indexed_db/proxy_webidbcursor_impl.cc ('k') | content/child/indexed_db/proxy_webidbdatabase_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698