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

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBTransactionTest.cpp

Issue 2890023003: [IndexedDB] Adding async tracing for renderer calls. (Closed)
Patch Set: test fix Created 3 years, 7 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
OLDNEW
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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 Persistent<IDBTransaction> transaction = 78 Persistent<IDBTransaction> transaction =
79 IDBTransaction::CreateNonVersionChange( 79 IDBTransaction::CreateNonVersionChange(
80 scope.GetScriptState(), kTransactionId, transaction_scope, 80 scope.GetScriptState(), kTransactionId, transaction_scope,
81 kWebIDBTransactionModeReadOnly, db.Get()); 81 kWebIDBTransactionModeReadOnly, db.Get());
82 PersistentHeapHashSet<WeakMember<IDBTransaction>> set; 82 PersistentHeapHashSet<WeakMember<IDBTransaction>> set;
83 set.insert(transaction); 83 set.insert(transaction);
84 84
85 ThreadState::Current()->CollectAllGarbage(); 85 ThreadState::Current()->CollectAllGarbage();
86 EXPECT_EQ(1u, set.size()); 86 EXPECT_EQ(1u, set.size());
87 87
88 Persistent<IDBRequest> request = IDBRequest::Create( 88 Persistent<IDBRequest> request =
89 scope.GetScriptState(), IDBAny::CreateUndefined(), transaction.Get()); 89 IDBRequest::Create(scope.GetScriptState(), IDBAny::CreateUndefined(),
90 transaction.Get(), IDBRequest::AsyncTraceState());
90 DeactivateNewTransactions(scope.GetIsolate()); 91 DeactivateNewTransactions(scope.GetIsolate());
91 92
92 ThreadState::Current()->CollectAllGarbage(); 93 ThreadState::Current()->CollectAllGarbage();
93 EXPECT_EQ(1u, set.size()); 94 EXPECT_EQ(1u, set.size());
94 95
95 // This will generate an Abort() call to the back end which is dropped by the 96 // This will generate an Abort() call to the back end which is dropped by the
96 // fake proxy, so an explicit OnAbort call is made. 97 // fake proxy, so an explicit OnAbort call is made.
97 scope.GetExecutionContext()->NotifyContextDestroyed(); 98 scope.GetExecutionContext()->NotifyContextDestroyed();
98 transaction->OnAbort(DOMException::Create(kAbortError, "Aborted")); 99 transaction->OnAbort(DOMException::Create(kAbortError, "Aborted"));
99 transaction.Clear(); 100 transaction.Clear();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 // The test will not fail if it is, but ASAN would notice the error. 144 // The test will not fail if it is, but ASAN would notice the error.
144 db->OnAbort(kTransactionId, DOMException::Create(kAbortError, "Aborted")); 145 db->OnAbort(kTransactionId, DOMException::Create(kAbortError, "Aborted"));
145 146
146 // OnAbort() should have cleared the transaction's reference to the database. 147 // OnAbort() should have cleared the transaction's reference to the database.
147 ThreadState::Current()->CollectAllGarbage(); 148 ThreadState::Current()->CollectAllGarbage();
148 EXPECT_EQ(0u, set.size()); 149 EXPECT_EQ(0u, set.size());
149 } 150 }
150 151
151 } // namespace 152 } // namespace
152 } // namespace blink 153 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698