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/common/ash_switches.h" | 7 #include "ash/common/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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 // navigation to tests, which should make sure navigations succeed when | 380 // navigation to tests, which should make sure navigations succeed when |
381 // appropriate. See https://crbug.com/425335 | 381 // appropriate. See https://crbug.com/425335 |
382 void InProcessBrowserTest::AddTabAtIndexToBrowser( | 382 void InProcessBrowserTest::AddTabAtIndexToBrowser( |
383 Browser* browser, | 383 Browser* browser, |
384 int index, | 384 int index, |
385 const GURL& url, | 385 const GURL& url, |
386 ui::PageTransition transition, | 386 ui::PageTransition transition, |
387 bool check_navigation_success) { | 387 bool check_navigation_success) { |
388 chrome::NavigateParams params(browser, url, transition); | 388 chrome::NavigateParams params(browser, url, transition); |
389 params.tabstrip_index = index; | 389 params.tabstrip_index = index; |
390 params.disposition = NEW_FOREGROUND_TAB; | 390 params.disposition = WindowOpenDisposition::NEW_FOREGROUND_TAB; |
391 chrome::Navigate(¶ms); | 391 chrome::Navigate(¶ms); |
392 | 392 |
393 if (check_navigation_success) | 393 if (check_navigation_success) |
394 content::WaitForLoadStop(params.target_contents); | 394 content::WaitForLoadStop(params.target_contents); |
395 else | 395 else |
396 content::WaitForLoadStopWithoutSuccessCheck(params.target_contents); | 396 content::WaitForLoadStopWithoutSuccessCheck(params.target_contents); |
397 } | 397 } |
398 | 398 |
399 void InProcessBrowserTest::AddTabAtIndex( | 399 void InProcessBrowserTest::AddTabAtIndex( |
400 int index, | 400 int index, |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 // On the Mac, this eventually reaches | 598 // On the Mac, this eventually reaches |
599 // -[BrowserWindowController windowWillClose:], which will post a deferred | 599 // -[BrowserWindowController windowWillClose:], which will post a deferred |
600 // -autorelease on itself to ultimately destroy the Browser object. The line | 600 // -autorelease on itself to ultimately destroy the Browser object. The line |
601 // below is necessary to pump these pending messages to ensure all Browsers | 601 // below is necessary to pump these pending messages to ensure all Browsers |
602 // get deleted. | 602 // get deleted. |
603 content::RunAllPendingInMessageLoop(); | 603 content::RunAllPendingInMessageLoop(); |
604 delete autorelease_pool_; | 604 delete autorelease_pool_; |
605 autorelease_pool_ = NULL; | 605 autorelease_pool_ = NULL; |
606 #endif | 606 #endif |
607 } | 607 } |
OLD | NEW |