Avi Drissman | 4e1b7bc3 | 2022-09-15 14:03:50 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors |
Gabriel Charette | c8cca99 | 2017-08-10 18:21:49 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "content/browser/after_startup_task_utils.h" |
| 6 | |
Carlos Caballero | c472c2bf | 2019-04-18 09:30:36 | [diff] [blame] | 7 | #include "content/browser/scheduler/browser_task_executor.h" |
Gabriel Charette | c8cca99 | 2017-08-10 18:21:49 | [diff] [blame] | 8 | #include "content/public/browser/content_browser_client.h" |
| 9 | #include "content/public/common/content_client.h" |
| 10 | |
| 11 | namespace content { |
| 12 | |
| 13 | void SetBrowserStartupIsCompleteForTesting() { |
Minoru Chikamune | a031756 | 2022-03-22 15:30:21 | [diff] [blame] | 14 | content::BrowserTaskExecutor::OnStartupComplete(); |
Gabriel Charette | c8cca99 | 2017-08-10 18:21:49 | [diff] [blame] | 15 | // Forward the message to ContentBrowserClient if one is registered (there are |
| 16 | // many tests where one isn't but that's fine as that also means they get the |
| 17 | // default ContentBrowserClient::IsBrowserStartupComplete() which is always |
| 18 | // true). |
| 19 | ContentClient* content_client = GetContentClient(); |
| 20 | if (content_client) { |
| 21 | ContentBrowserClient* content_browser_client = content_client->browser(); |
| 22 | if (content_browser_client) |
| 23 | content_browser_client->SetBrowserStartupIsCompleteForTesting(); |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | } // namespace content |