| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "base/auto_reset.h" | 8 #include "base/auto_reset.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 content::WebContents* web_contents) { | 424 content::WebContents* web_contents) { |
| 425 ASSERT_FALSE(content::DevToolsAgentHost::HasFor(web_contents)); | 425 ASSERT_FALSE(content::DevToolsAgentHost::HasFor(web_contents)); |
| 426 DevToolsWindow::OpenDevToolsWindow(web_contents); | 426 DevToolsWindow::OpenDevToolsWindow(web_contents); |
| 427 ASSERT_TRUE(content::DevToolsAgentHost::HasFor(web_contents)); | 427 ASSERT_TRUE(content::DevToolsAgentHost::HasFor(web_contents)); |
| 428 } | 428 } |
| 429 | 429 |
| 430 Browser* InProcessBrowserTest::OpenURLOffTheRecord(Profile* profile, | 430 Browser* InProcessBrowserTest::OpenURLOffTheRecord(Profile* profile, |
| 431 const GURL& url) { | 431 const GURL& url) { |
| 432 chrome::HostDesktopType active_desktop = chrome::GetActiveDesktop(); | 432 chrome::HostDesktopType active_desktop = chrome::GetActiveDesktop(); |
| 433 chrome::OpenURLOffTheRecord(profile, url, active_desktop); | 433 chrome::OpenURLOffTheRecord(profile, url, active_desktop); |
| 434 Browser* browser = chrome::FindTabbedBrowser( | 434 Browser* browser = |
| 435 profile->GetOffTheRecordProfile(), false, active_desktop); | 435 chrome::FindTabbedBrowser(profile->GetOffTheRecordProfile(), false); |
| 436 content::TestNavigationObserver observer( | 436 content::TestNavigationObserver observer( |
| 437 browser->tab_strip_model()->GetActiveWebContents()); | 437 browser->tab_strip_model()->GetActiveWebContents()); |
| 438 observer.Wait(); | 438 observer.Wait(); |
| 439 return browser; | 439 return browser; |
| 440 } | 440 } |
| 441 | 441 |
| 442 // Creates a browser with a single tab (about:blank), waits for the tab to | 442 // Creates a browser with a single tab (about:blank), waits for the tab to |
| 443 // finish loading and shows the browser. | 443 // finish loading and shows the browser. |
| 444 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { | 444 Browser* InProcessBrowserTest::CreateBrowser(Profile* profile) { |
| 445 Browser* browser = new Browser( | 445 Browser* browser = new Browser( |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 // On the Mac, this eventually reaches | 612 // On the Mac, this eventually reaches |
| 613 // -[BrowserWindowController windowWillClose:], which will post a deferred | 613 // -[BrowserWindowController windowWillClose:], which will post a deferred |
| 614 // -autorelease on itself to ultimately destroy the Browser object. The line | 614 // -autorelease on itself to ultimately destroy the Browser object. The line |
| 615 // below is necessary to pump these pending messages to ensure all Browsers | 615 // below is necessary to pump these pending messages to ensure all Browsers |
| 616 // get deleted. | 616 // get deleted. |
| 617 content::RunAllPendingInMessageLoop(); | 617 content::RunAllPendingInMessageLoop(); |
| 618 delete autorelease_pool_; | 618 delete autorelease_pool_; |
| 619 autorelease_pool_ = NULL; | 619 autorelease_pool_ = NULL; |
| 620 #endif | 620 #endif |
| 621 } | 621 } |
| OLD | NEW |