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/test/base/in_process_browser_test.h" | 5 #include "chrome/test/base/in_process_browser_test.h" |
6 | 6 |
7 #include "base/mac/scoped_nsautorelease_pool.h" | 7 #include "base/mac/scoped_nsautorelease_pool.h" |
8 #include "chrome/browser/devtools/devtools_window.h" | 8 #include "chrome/browser/devtools/devtools_window.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 } | 25 } |
26 | 26 |
27 Browser* InProcessBrowserTest::OpenURLOffTheRecord(Profile* profile, | 27 Browser* InProcessBrowserTest::OpenURLOffTheRecord(Profile* profile, |
28 const GURL& url) { | 28 const GURL& url) { |
29 // Opening an incognito window can cause AppKit to throw objects into the | 29 // Opening an incognito window can cause AppKit to throw objects into the |
30 // autorelease pool. Flush the pool when this function returns. | 30 // autorelease pool. Flush the pool when this function returns. |
31 base::mac::ScopedNSAutoreleasePool pool; | 31 base::mac::ScopedNSAutoreleasePool pool; |
32 | 32 |
33 chrome::HostDesktopType active_desktop = chrome::GetActiveDesktop(); | 33 chrome::HostDesktopType active_desktop = chrome::GetActiveDesktop(); |
34 chrome::OpenURLOffTheRecord(profile, url, active_desktop); | 34 chrome::OpenURLOffTheRecord(profile, url, active_desktop); |
35 Browser* browser = chrome::FindTabbedBrowser( | 35 Browser* browser = |
36 profile->GetOffTheRecordProfile(), false, active_desktop); | 36 chrome::FindTabbedBrowser(profile->GetOffTheRecordProfile(), false); |
37 content::TestNavigationObserver observer( | 37 content::TestNavigationObserver observer( |
38 browser->tab_strip_model()->GetActiveWebContents()); | 38 browser->tab_strip_model()->GetActiveWebContents()); |
39 observer.Wait(); | 39 observer.Wait(); |
40 return browser; | 40 return browser; |
41 } | 41 } |
42 | 42 |
43 // Creates a browser with a single tab (about:blank), waits for the tab to | 43 // Creates a browser with a single tab (about:blank), waits for the tab to |
44 // finish loading and shows the browser. | 44 // finish loading and shows the browser. |
45 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { | 45 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { |
46 // Making a browser window can cause AppKit to throw objects into the | 46 // Making a browser window can cause AppKit to throw objects into the |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // autorelease pool. Flush the pool when this function returns. | 85 // autorelease pool. Flush the pool when this function returns. |
86 base::mac::ScopedNSAutoreleasePool pool; | 86 base::mac::ScopedNSAutoreleasePool pool; |
87 | 87 |
88 Browser* browser = new Browser( | 88 Browser* browser = new Browser( |
89 Browser::CreateParams::CreateForApp( | 89 Browser::CreateParams::CreateForApp( |
90 app_name, false /* trusted_source */, gfx::Rect(), profile, | 90 app_name, false /* trusted_source */, gfx::Rect(), profile, |
91 chrome::GetActiveDesktop())); | 91 chrome::GetActiveDesktop())); |
92 AddBlankTabAndShow(browser); | 92 AddBlankTabAndShow(browser); |
93 return browser; | 93 return browser; |
94 } | 94 } |
OLD | NEW |