Index: trunk/src/content/child/indexed_db/webidbcursor_impl_unittest.cc |
=================================================================== |
--- trunk/src/content/child/indexed_db/webidbcursor_impl_unittest.cc (revision 243358) |
+++ trunk/src/content/child/indexed_db/webidbcursor_impl_unittest.cc (working copy) |
@@ -30,8 +30,6 @@ |
: IndexedDBDispatcher(thread_safe_sender), |
prefetch_calls_(0), |
last_prefetch_count_(0), |
- reset_calls_(0), |
- last_used_count_(0), |
advance_calls_(0), |
continue_calls_(0), |
destroyed_cursor_id_(0) {} |
@@ -44,13 +42,6 @@ |
callbacks_.reset(callbacks); |
} |
- virtual void RequestIDBCursorPrefetchReset(int used_prefetches, |
- int unused_prefetches, |
- int32 ipc_cursor_id) OVERRIDE { |
- ++reset_calls_; |
- last_used_count_ = used_prefetches; |
- } |
- |
virtual void RequestIDBCursorAdvance(unsigned long count, |
WebIDBCallbacks* callbacks, |
int32 ipc_cursor_id) OVERRIDE { |
@@ -71,18 +62,14 @@ |
} |
int prefetch_calls() { return prefetch_calls_; } |
- int last_prefetch_count() { return last_prefetch_count_; } |
- int reset_calls() { return reset_calls_; } |
- int last_used_count() { return last_used_count_; } |
int advance_calls() { return advance_calls_; } |
int continue_calls() { return continue_calls_; } |
+ int last_prefetch_count() { return last_prefetch_count_; } |
int32 destroyed_cursor_id() { return destroyed_cursor_id_; } |
private: |
int prefetch_calls_; |
int last_prefetch_count_; |
- int reset_calls_; |
- int last_used_count_; |
int advance_calls_; |
int continue_calls_; |
int32 destroyed_cursor_id_; |
@@ -260,47 +247,4 @@ |
dispatcher_->continue_calls()); |
} |
-TEST_F(WebIDBCursorImplTest, PrefetchReset) { |
- WebIDBCursorImpl cursor(WebIDBCursorImpl::kInvalidCursorId, |
- thread_safe_sender_.get()); |
- |
- // Call continue() until prefetching should kick in. |
- int continue_calls = 0; |
- EXPECT_EQ(dispatcher_->continue_calls(), 0); |
- for (int i = 0; i < WebIDBCursorImpl::kPrefetchContinueThreshold; ++i) { |
- cursor.continueFunction(null_key_, new MockContinueCallbacks()); |
- EXPECT_EQ(++continue_calls, dispatcher_->continue_calls()); |
- EXPECT_EQ(0, dispatcher_->prefetch_calls()); |
- } |
- |
- // Initiate the prefetch |
- cursor.continueFunction(null_key_, new MockContinueCallbacks()); |
- EXPECT_EQ(continue_calls, dispatcher_->continue_calls()); |
- EXPECT_EQ(1, dispatcher_->prefetch_calls()); |
- EXPECT_EQ(0, dispatcher_->reset_calls()); |
- |
- // Now invalidate it |
- cursor.ResetPrefetchCache(); |
- |
- // No reset should have been sent since nothing has been received yet. |
- EXPECT_EQ(0, dispatcher_->reset_calls()); |
- |
- // Fill the prefetch cache as requested. |
- int prefetch_count = dispatcher_->last_prefetch_count(); |
- std::vector<IndexedDBKey> keys(prefetch_count); |
- std::vector<IndexedDBKey> primary_keys(prefetch_count); |
- std::vector<WebData> values(prefetch_count); |
- cursor.SetPrefetchData(keys, primary_keys, values); |
- |
- // No reset should have been sent since prefetch data hasn't been used. |
- EXPECT_EQ(0, dispatcher_->reset_calls()); |
- |
- // The real dispatcher would call cursor->CachedContinue(), so do that: |
- cursor.CachedContinue(new MockContinueCallbacks()); |
- |
- // Now the cursor should have reset the rest of the cache. |
- EXPECT_EQ(1, dispatcher_->reset_calls()); |
- EXPECT_EQ(1, dispatcher_->last_used_count()); |
-} |
- |
} // namespace content |