Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(743)

Side by Side Diff: Source/modules/indexeddb/IDBRequestTest.cpp

Issue 1035963002: IDBRequestTest.AbortErrorAfterAbort: stop request on exit. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 IDBTransaction* transaction = nullptr; 102 IDBTransaction* transaction = nullptr;
103 IDBRequest* request = IDBRequest::create(scriptState(), IDBAny::createUndefi ned(), transaction); 103 IDBRequest* request = IDBRequest::create(scriptState(), IDBAny::createUndefi ned(), transaction);
104 EXPECT_EQ(request->readyState(), "pending"); 104 EXPECT_EQ(request->readyState(), "pending");
105 105
106 // Simulate the IDBTransaction having received onAbort from back end and abo rting the request: 106 // Simulate the IDBTransaction having received onAbort from back end and abo rting the request:
107 request->abort(); 107 request->abort();
108 108
109 // Now simulate the back end having fired an abort error at the request to c lear up any intermediaries. 109 // Now simulate the back end having fired an abort error at the request to c lear up any intermediaries.
110 // Ensure an assertion is not raised. 110 // Ensure an assertion is not raised.
111 request->onError(DOMError::create(AbortError, "Description goes here.")); 111 request->onError(DOMError::create(AbortError, "Description goes here."));
112
113 // Stop the request lest it be GCed and its destructor
114 // finds the object in a pending state (and asserts.)
115 executionContext()->stopActiveDOMObjects();
112 } 116 }
113 117
114 class MockWebIDBDatabase : public WebIDBDatabase { 118 class MockWebIDBDatabase : public WebIDBDatabase {
115 public: 119 public:
116 static PassOwnPtr<MockWebIDBDatabase> create() 120 static PassOwnPtr<MockWebIDBDatabase> create()
117 { 121 {
118 return adoptPtr(new MockWebIDBDatabase()); 122 return adoptPtr(new MockWebIDBDatabase());
119 } 123 }
120 virtual ~MockWebIDBDatabase() 124 virtual ~MockWebIDBDatabase()
121 { 125 {
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState(), call backs, transactionId, version); 163 IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState(), call backs, transactionId, version);
160 EXPECT_EQ(request->readyState(), "pending"); 164 EXPECT_EQ(request->readyState(), "pending");
161 165
162 executionContext()->stopActiveDOMObjects(); 166 executionContext()->stopActiveDOMObjects();
163 request->onSuccess(backend.release(), metadata); 167 request->onSuccess(backend.release(), metadata);
164 } 168 }
165 } 169 }
166 170
167 } // namespace 171 } // namespace
168 } // namespace blink 172 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698