| OLD | NEW |
| 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/indexed_db_key_builders.h" |
| 8 #include "content/child/indexed_db/proxy_webidbcursor_impl.h" | 9 #include "content/child/indexed_db/proxy_webidbcursor_impl.h" |
| 9 #include "content/child/thread_safe_sender.h" | 10 #include "content/child/thread_safe_sender.h" |
| 10 #include "content/common/indexed_db/indexed_db_key.h" | 11 #include "content/common/indexed_db/indexed_db_key.h" |
| 11 #include "ipc/ipc_sync_message_filter.h" | 12 #include "ipc/ipc_sync_message_filter.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/WebKit/public/platform/WebData.h" | 14 #include "third_party/WebKit/public/platform/WebData.h" |
| 14 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h" | 15 #include "third_party/WebKit/public/platform/WebIDBCallbacks.h" |
| 15 | 16 |
| 16 using WebKit::WebData; | 17 using WebKit::WebData; |
| 17 using WebKit::WebIDBCallbacks; | 18 using WebKit::WebIDBCallbacks; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 67 |
| 67 class MockContinueCallbacks : public WebIDBCallbacks { | 68 class MockContinueCallbacks : public WebIDBCallbacks { |
| 68 public: | 69 public: |
| 69 MockContinueCallbacks(IndexedDBKey* key = 0) : key_(key) {} | 70 MockContinueCallbacks(IndexedDBKey* key = 0) : key_(key) {} |
| 70 | 71 |
| 71 virtual void onSuccess(const WebIDBKey& key, | 72 virtual void onSuccess(const WebIDBKey& key, |
| 72 const WebIDBKey& primaryKey, | 73 const WebIDBKey& primaryKey, |
| 73 const WebData& value) { | 74 const WebData& value) { |
| 74 | 75 |
| 75 if (key_) | 76 if (key_) |
| 76 *key_ = IndexedDBKey(key); | 77 *key_ = IndexedDBKeyBuilder::Build(key); |
| 77 } | 78 } |
| 78 | 79 |
| 79 private: | 80 private: |
| 80 IndexedDBKey* key_; | 81 IndexedDBKey* key_; |
| 81 }; | 82 }; |
| 82 | 83 |
| 83 } // namespace | 84 } // namespace |
| 84 | 85 |
| 85 TEST(RendererWebIDBCursorImplTest, PrefetchTest) { | 86 TEST(RendererWebIDBCursorImplTest, PrefetchTest) { |
| 86 | 87 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 EXPECT_EQ(expected_key++, key.number()); | 154 EXPECT_EQ(expected_key++, key.number()); |
| 154 } | 155 } |
| 155 } | 156 } |
| 156 } | 157 } |
| 157 | 158 |
| 158 EXPECT_EQ(dispatcher.destroyed_cursor_id(), | 159 EXPECT_EQ(dispatcher.destroyed_cursor_id(), |
| 159 RendererWebIDBCursorImpl::kInvalidCursorId); | 160 RendererWebIDBCursorImpl::kInvalidCursorId); |
| 160 } | 161 } |
| 161 | 162 |
| 162 } // namespace content | 163 } // namespace content |
| OLD | NEW |