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

Unified Diff: chrome/browser/chromeos/file_system_provider/queue_unittest.cc

Issue 925873002: Fix a queue for FSP API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « chrome/browser/chromeos/file_system_provider/queue.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/file_system_provider/queue_unittest.cc
diff --git a/chrome/browser/chromeos/file_system_provider/queue_unittest.cc b/chrome/browser/chromeos/file_system_provider/queue_unittest.cc
index 5b2fbe1c68606f760f964dcd3e82f6f685aac2e1..62edba9fccb81fea5779e2a93161fa10cca3a06f 100644
--- a/chrome/browser/chromeos/file_system_provider/queue_unittest.cc
+++ b/chrome/browser/chromeos/file_system_provider/queue_unittest.cc
@@ -113,6 +113,30 @@ TEST_F(FileSystemProviderQueueTest, Enqueue_OneAtOnce) {
EXPECT_EQ(0, third_abort_counter);
}
+TEST_F(FileSystemProviderQueueTest, Enqueue_WhilePreviousNotRemoved) {
+ Queue queue(1);
+ const size_t first_token = queue.NewToken();
+ int first_counter = 0;
+ int first_abort_counter = 0;
+ queue.Enqueue(first_token,
+ base::Bind(&OnRun, &first_counter, &first_abort_counter));
+
+ base::RunLoop().RunUntilIdle();
+ queue.Complete(first_token);
+
+ // Enqueuing a new task must not start it, once the queue is filled with a
+ // completed task.
+ const size_t second_token = queue.NewToken();
+ int second_counter = 0;
+ int second_abort_counter = 0;
+ queue.Enqueue(second_token,
+ base::Bind(&OnRun, &second_counter, &second_abort_counter));
+
+ base::RunLoop().RunUntilIdle();
+ EXPECT_EQ(0, second_counter);
+ EXPECT_EQ(0, second_abort_counter);
+}
+
TEST_F(FileSystemProviderQueueTest, Enqueue_MultipleAtOnce) {
Queue queue(2);
const size_t first_token = queue.NewToken();
« no previous file with comments | « chrome/browser/chromeos/file_system_provider/queue.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698