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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "chrome/browser/extensions/extension_service_unittest.h" | 9 #include "chrome/browser/extensions/extension_service_unittest.h" |
10 #include "chrome/browser/extensions/test_extension_system.h" | 10 #include "chrome/browser/extensions/test_extension_system.h" |
11 #include "chrome/common/extensions/extension.h" | |
12 #include "chrome/test/base/testing_profile.h" | 11 #include "chrome/test/base/testing_profile.h" |
13 #include "content/public/test/test_browser_thread_bundle.h" | 12 #include "content/public/test/test_browser_thread_bundle.h" |
14 #include "extensions/browser/process_manager.h" | 13 #include "extensions/browser/process_manager.h" |
| 14 #include "extensions/common/extension.h" |
15 #include "extensions/common/extension_builder.h" | 15 #include "extensions/common/extension_builder.h" |
16 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
17 | 17 |
18 namespace extensions { | 18 namespace extensions { |
19 | 19 |
20 // A ProcessManager that doesn't create background host pages. | 20 // A ProcessManager that doesn't create background host pages. |
21 class TestProcessManager : public ProcessManager { | 21 class TestProcessManager : public ProcessManager { |
22 public: | 22 public: |
23 explicit TestProcessManager(Profile* profile) | 23 explicit TestProcessManager(Profile* profile) |
24 : ProcessManager(profile, profile->GetOriginalProfile()), | 24 : ProcessManager(profile, profile->GetOriginalProfile()), |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 EXPECT_EQ(1u, queue.extensions_with_pending_tasks()); | 184 EXPECT_EQ(1u, queue.extensions_with_pending_tasks()); |
185 | 185 |
186 // Processing tasks when there is one pending runs the task and removes the | 186 // Processing tasks when there is one pending runs the task and removes the |
187 // extension from the list of extensions with pending tasks. | 187 // extension from the list of extensions with pending tasks. |
188 queue.ProcessPendingTasks(NULL, profile_.get(), extension); | 188 queue.ProcessPendingTasks(NULL, profile_.get(), extension); |
189 EXPECT_EQ(1, task_run_count()); | 189 EXPECT_EQ(1, task_run_count()); |
190 EXPECT_EQ(0u, queue.extensions_with_pending_tasks()); | 190 EXPECT_EQ(0u, queue.extensions_with_pending_tasks()); |
191 } | 191 } |
192 | 192 |
193 } // namespace extensions | 193 } // namespace extensions |
OLD | NEW |