OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 TEST_F(IDBRequestTest, EventsAfterStopping) | 92 TEST_F(IDBRequestTest, EventsAfterStopping) |
93 { | 93 { |
94 IDBTransaction* transaction = 0; | 94 IDBTransaction* transaction = 0; |
95 RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::
createUndefined(), transaction); | 95 RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::
createUndefined(), transaction); |
96 EXPECT_EQ(request->readyState(), "pending"); | 96 EXPECT_EQ(request->readyState(), "pending"); |
97 executionContext()->stopActiveDOMObjects(); | 97 executionContext()->stopActiveDOMObjects(); |
98 | 98 |
99 // Ensure none of the following raise assertions in stopped state: | 99 // Ensure none of the following raise assertions in stopped state: |
100 request->onError(DOMError::create(AbortError, "Description goes here.")); | 100 request->onError(DOMError::create(AbortError, "Description goes here.")); |
101 request->onSuccess(Vector<String>()); | 101 request->onSuccess(Vector<String>()); |
102 request->onSuccess(nullptr, IDBKey::createInvalid(), IDBKey::createInvalid()
, 0); | 102 request->onSuccess(nullptr, IDBKey::createInvalid(), IDBKey::createInvalid()
, nullptr); |
103 request->onSuccess(IDBKey::createInvalid()); | 103 request->onSuccess(IDBKey::createInvalid()); |
104 request->onSuccess(PassRefPtr<SharedBuffer>(0)); | 104 request->onSuccess(PassRefPtr<SharedBuffer>(nullptr)); |
105 request->onSuccess(PassRefPtr<SharedBuffer>(0), IDBKey::createInvalid(), IDB
KeyPath()); | 105 request->onSuccess(PassRefPtr<SharedBuffer>(nullptr), IDBKey::createInvalid(
), IDBKeyPath()); |
106 request->onSuccess(0LL); | 106 request->onSuccess(0LL); |
107 request->onSuccess(); | 107 request->onSuccess(); |
108 request->onSuccess(IDBKey::createInvalid(), IDBKey::createInvalid(), 0); | 108 request->onSuccess(IDBKey::createInvalid(), IDBKey::createInvalid(), nullptr
); |
109 } | 109 } |
110 | 110 |
111 TEST_F(IDBRequestTest, AbortErrorAfterAbort) | 111 TEST_F(IDBRequestTest, AbortErrorAfterAbort) |
112 { | 112 { |
113 IDBTransaction* transaction = 0; | 113 IDBTransaction* transaction = 0; |
114 RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::
createUndefined(), transaction); | 114 RefPtr<IDBRequest> request = IDBRequest::create(executionContext(), IDBAny::
createUndefined(), transaction); |
115 EXPECT_EQ(request->readyState(), "pending"); | 115 EXPECT_EQ(request->readyState(), "pending"); |
116 | 116 |
117 // Simulate the IDBTransaction having received onAbort from back end and abo
rting the request: | 117 // Simulate the IDBTransaction having received onAbort from back end and abo
rting the request: |
118 request->abort(); | 118 request->abort(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create(); | 169 OwnPtr<MockWebIDBDatabase> backend = MockWebIDBDatabase::create(); |
170 RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(executionCon
text(), callbacks, transactionId, version); | 170 RefPtr<IDBOpenDBRequest> request = IDBOpenDBRequest::create(executionCon
text(), callbacks, transactionId, version); |
171 EXPECT_EQ(request->readyState(), "pending"); | 171 EXPECT_EQ(request->readyState(), "pending"); |
172 | 172 |
173 executionContext()->stopActiveDOMObjects(); | 173 executionContext()->stopActiveDOMObjects(); |
174 request->onSuccess(backend.release(), metadata); | 174 request->onSuccess(backend.release(), metadata); |
175 } | 175 } |
176 } | 176 } |
177 | 177 |
178 } // namespace | 178 } // namespace |
OLD | NEW |