OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/after_startup_task_utils.h" | 5 #include "chrome/browser/after_startup_task_utils.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "base/message_loop/message_loop_proxy.h" | |
13 #include "base/run_loop.h" | 12 #include "base/run_loop.h" |
14 #include "base/task_runner_util.h" | 13 #include "base/task_runner_util.h" |
| 14 #include "base/thread_task_runner_handle.h" |
15 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
16 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/test/test_browser_thread_bundle.h" | 17 #include "content/public/test/test_browser_thread_bundle.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 using base::RunLoop; | 20 using base::RunLoop; |
21 using content::BrowserThread; | 21 using content::BrowserThread; |
22 using content::TestBrowserThreadBundle; | 22 using content::TestBrowserThreadBundle; |
23 | 23 |
24 namespace { | 24 namespace { |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 base::Bind(&base::DoNothing)); | 190 base::Bind(&base::DoNothing)); |
191 PostAfterStartupTaskFromDBThread(FROM_HERE, db_thread_, | 191 PostAfterStartupTaskFromDBThread(FROM_HERE, db_thread_, |
192 base::Bind(&base::DoNothing)); | 192 base::Bind(&base::DoNothing)); |
193 EXPECT_EQ(2, db_thread_->posted_task_count()); | 193 EXPECT_EQ(2, db_thread_->posted_task_count()); |
194 EXPECT_EQ(2, ui_thread_->posted_task_count()); | 194 EXPECT_EQ(2, ui_thread_->posted_task_count()); |
195 FlushDBThread(); | 195 FlushDBThread(); |
196 RunLoop().RunUntilIdle(); | 196 RunLoop().RunUntilIdle(); |
197 EXPECT_EQ(2, db_thread_->ran_task_count()); | 197 EXPECT_EQ(2, db_thread_->ran_task_count()); |
198 EXPECT_EQ(2, ui_thread_->ran_task_count()); | 198 EXPECT_EQ(2, ui_thread_->ran_task_count()); |
199 } | 199 } |
OLD | NEW |