OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 12 matching lines...) Expand all Loading... |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "modules/indexeddb/IDBTransaction.h" | 31 #include "modules/indexeddb/IDBTransaction.h" |
32 | 32 |
| 33 #include <v8.h> |
| 34 #include <memory> |
33 #include "bindings/core/v8/V8BindingForTesting.h" | 35 #include "bindings/core/v8/V8BindingForTesting.h" |
34 #include "core/dom/DOMException.h" | 36 #include "core/dom/DOMException.h" |
35 #include "core/dom/Document.h" | 37 #include "core/dom/Document.h" |
36 #include "core/dom/ExceptionCode.h" | 38 #include "core/dom/ExceptionCode.h" |
37 #include "modules/indexeddb/IDBDatabase.h" | 39 #include "modules/indexeddb/IDBDatabase.h" |
38 #include "modules/indexeddb/IDBDatabaseCallbacks.h" | 40 #include "modules/indexeddb/IDBDatabaseCallbacks.h" |
39 #include "modules/indexeddb/MockWebIDBDatabase.h" | 41 #include "modules/indexeddb/MockWebIDBDatabase.h" |
40 #include "platform/SharedBuffer.h" | 42 #include "platform/SharedBuffer.h" |
41 #include "testing/gtest/include/gtest/gtest.h" | 43 #include "testing/gtest/include/gtest/gtest.h" |
42 #include <memory> | |
43 #include <v8.h> | |
44 | 44 |
45 namespace blink { | 45 namespace blink { |
46 namespace { | 46 namespace { |
47 | 47 |
48 void deactivateNewTransactions(v8::Isolate* isolate) { | 48 void deactivateNewTransactions(v8::Isolate* isolate) { |
49 V8PerIsolateData::from(isolate)->runEndOfScopeTasks(); | 49 V8PerIsolateData::from(isolate)->runEndOfScopeTasks(); |
50 } | 50 } |
51 | 51 |
52 class FakeIDBDatabaseCallbacks final : public IDBDatabaseCallbacks { | 52 class FakeIDBDatabaseCallbacks final : public IDBDatabaseCallbacks { |
53 public: | 53 public: |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 // The test will not fail if it is, but ASAN would notice the error. | 142 // The test will not fail if it is, but ASAN would notice the error. |
143 db->onAbort(transactionId, DOMException::create(AbortError, "Aborted")); | 143 db->onAbort(transactionId, DOMException::create(AbortError, "Aborted")); |
144 | 144 |
145 // onAbort() should have cleared the transaction's reference to the database. | 145 // onAbort() should have cleared the transaction's reference to the database. |
146 ThreadState::current()->collectAllGarbage(); | 146 ThreadState::current()->collectAllGarbage(); |
147 EXPECT_EQ(0u, set.size()); | 147 EXPECT_EQ(0u, set.size()); |
148 } | 148 } |
149 | 149 |
150 } // namespace | 150 } // namespace |
151 } // namespace blink | 151 } // namespace blink |
OLD | NEW |