| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "extensions/browser/lazy_background_task_queue.h" | 5 #include "extensions/browser/lazy_background_task_queue.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 int create_count_; | 54 int create_count_; |
| 55 | 55 |
| 56 DISALLOW_COPY_AND_ASSIGN(TestProcessManager); | 56 DISALLOW_COPY_AND_ASSIGN(TestProcessManager); |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 std::unique_ptr<KeyedService> CreateTestProcessManager( | 59 std::unique_ptr<KeyedService> CreateTestProcessManager( |
| 60 BrowserContext* context) { | 60 BrowserContext* context) { |
| 61 return base::WrapUnique(new TestProcessManager(context)); | 61 return base::MakeUnique<TestProcessManager>(context); |
| 62 } | 62 } |
| 63 | 63 |
| 64 } // namespace | 64 } // namespace |
| 65 | 65 |
| 66 // Derives from ExtensionsTest to provide content module and keyed service | 66 // Derives from ExtensionsTest to provide content module and keyed service |
| 67 // initialization. | 67 // initialization. |
| 68 class LazyBackgroundTaskQueueTest : public ExtensionsTest { | 68 class LazyBackgroundTaskQueueTest : public ExtensionsTest { |
| 69 public: | 69 public: |
| 70 LazyBackgroundTaskQueueTest() : task_run_count_(0) {} | 70 LazyBackgroundTaskQueueTest() : task_run_count_(0) {} |
| 71 ~LazyBackgroundTaskQueueTest() override {} | 71 ~LazyBackgroundTaskQueueTest() override {} |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 EXPECT_EQ(1u, queue.extensions_with_pending_tasks()); | 209 EXPECT_EQ(1u, queue.extensions_with_pending_tasks()); |
| 210 | 210 |
| 211 // Processing tasks when there is one pending runs the task and removes the | 211 // Processing tasks when there is one pending runs the task and removes the |
| 212 // extension from the list of extensions with pending tasks. | 212 // extension from the list of extensions with pending tasks. |
| 213 queue.ProcessPendingTasks(NULL, browser_context(), extension.get()); | 213 queue.ProcessPendingTasks(NULL, browser_context(), extension.get()); |
| 214 EXPECT_EQ(1, task_run_count()); | 214 EXPECT_EQ(1, task_run_count()); |
| 215 EXPECT_EQ(0u, queue.extensions_with_pending_tasks()); | 215 EXPECT_EQ(0u, queue.extensions_with_pending_tasks()); |
| 216 } | 216 } |
| 217 | 217 |
| 218 } // namespace extensions | 218 } // namespace extensions |
| OLD | NEW |