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

Unified Diff: content/browser/indexed_db/indexed_db_transaction_unittest.cc

Issue 228843002: IndexedDBTransactionTest::Timeout now calls Timeout(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed out-of-date comment Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/indexed_db/indexed_db_transaction.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/indexed_db/indexed_db_transaction_unittest.cc
diff --git a/content/browser/indexed_db/indexed_db_transaction_unittest.cc b/content/browser/indexed_db/indexed_db_transaction_unittest.cc
index 56dfd7c519f97d5c727deb7317dc6357d0d0ae49..1e212bbde7e81587c35352fa83038f6023768ff2 100644
--- a/content/browser/indexed_db/indexed_db_transaction_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_transaction_unittest.cc
@@ -62,25 +62,32 @@ TEST_F(IndexedDBTransactionTest, Timeout) {
// No conflicting transactions, so coordinator will start it immediately:
EXPECT_EQ(IndexedDBTransaction::STARTED, transaction->state());
EXPECT_FALSE(transaction->IsTimeoutTimerRunning());
+ EXPECT_EQ(0, transaction->diagnostics().tasks_scheduled);
+ EXPECT_EQ(0, transaction->diagnostics().tasks_completed);
// Schedule a task - timer won't be started until it's processed.
transaction->ScheduleTask(base::Bind(
&IndexedDBTransactionTest::DummyOperation, base::Unretained(this)));
EXPECT_FALSE(transaction->IsTimeoutTimerRunning());
+ EXPECT_EQ(1, transaction->diagnostics().tasks_scheduled);
+ EXPECT_EQ(0, transaction->diagnostics().tasks_completed);
RunPostedTasks();
EXPECT_TRUE(transaction->IsTimeoutTimerRunning());
- // Abort should cancel the timer.
- transaction->Abort();
+ transaction->Timeout();
EXPECT_EQ(IndexedDBTransaction::FINISHED, transaction->state());
EXPECT_FALSE(transaction->IsTimeoutTimerRunning());
+ EXPECT_EQ(1, transaction->diagnostics().tasks_scheduled);
+ EXPECT_EQ(1, transaction->diagnostics().tasks_completed);
// This task will be ignored.
transaction->ScheduleTask(base::Bind(
&IndexedDBTransactionTest::DummyOperation, base::Unretained(this)));
EXPECT_EQ(IndexedDBTransaction::FINISHED, transaction->state());
EXPECT_FALSE(transaction->IsTimeoutTimerRunning());
+ EXPECT_EQ(1, transaction->diagnostics().tasks_scheduled);
+ EXPECT_EQ(1, transaction->diagnostics().tasks_completed);
}
TEST_F(IndexedDBTransactionTest, NoTimeoutReadOnly) {
« no previous file with comments | « content/browser/indexed_db/indexed_db_transaction.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698