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 "content/child/indexed_db/webidbcursor_impl.h" | 5 #include "content/child/indexed_db/webidbcursor_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 }; | 115 }; |
116 | 116 |
117 } // namespace | 117 } // namespace |
118 | 118 |
119 class WebIDBCursorImplTest : public testing::Test { | 119 class WebIDBCursorImplTest : public testing::Test { |
120 public: | 120 public: |
121 WebIDBCursorImplTest() { | 121 WebIDBCursorImplTest() { |
122 null_key_.assignNull(); | 122 null_key_.assignNull(); |
123 indexed_db::mojom::CursorAssociatedPtr ptr; | 123 indexed_db::mojom::CursorAssociatedPtr ptr; |
124 mock_cursor_ = | 124 mock_cursor_ = |
125 base::MakeUnique<MockCursorImpl>(mojo::MakeRequestForTesting(&ptr)); | 125 base::MakeUnique<MockCursorImpl>(mojo::MakeIsolatedRequest(&ptr)); |
126 cursor_ = base::MakeUnique<WebIDBCursorImpl>( | 126 cursor_ = base::MakeUnique<WebIDBCursorImpl>( |
127 ptr.PassInterface(), 1, base::ThreadTaskRunnerHandle::Get()); | 127 ptr.PassInterface(), 1, base::ThreadTaskRunnerHandle::Get()); |
128 } | 128 } |
129 | 129 |
130 protected: | 130 protected: |
131 base::MessageLoop message_loop_; | 131 base::MessageLoop message_loop_; |
132 WebIDBKey null_key_; | 132 WebIDBKey null_key_; |
133 std::unique_ptr<WebIDBCursorImpl> cursor_; | 133 std::unique_ptr<WebIDBCursorImpl> cursor_; |
134 std::unique_ptr<MockCursorImpl> mock_cursor_; | 134 std::unique_ptr<MockCursorImpl> mock_cursor_; |
135 | 135 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 base::RunLoop().RunUntilIdle(); | 322 base::RunLoop().RunUntilIdle(); |
323 EXPECT_EQ(1, mock_cursor_->reset_calls()); | 323 EXPECT_EQ(1, mock_cursor_->reset_calls()); |
324 EXPECT_EQ(1, mock_cursor_->last_used_count()); | 324 EXPECT_EQ(1, mock_cursor_->last_used_count()); |
325 | 325 |
326 cursor_.reset(); | 326 cursor_.reset(); |
327 base::RunLoop().RunUntilIdle(); | 327 base::RunLoop().RunUntilIdle(); |
328 EXPECT_TRUE(mock_cursor_->destroyed()); | 328 EXPECT_TRUE(mock_cursor_->destroyed()); |
329 } | 329 } |
330 | 330 |
331 } // namespace content | 331 } // namespace content |
OLD | NEW |