1 // Copyright 2017 The Chromium Authors. All rights reserved.
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 
7 #include "content/browser/scheduler/browser_task_executor.h"
8 #include "content/public/browser/content_browser_client.h"
9 #include "content/public/common/content_client.h"
10 
11 namespace content {
12 
SetBrowserStartupIsCompleteForTesting()13 void SetBrowserStartupIsCompleteForTesting() {
14   content::BrowserTaskExecutor::EnableAllQueues();
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
28