| 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/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } // namespace | 135 } // namespace |
| 136 | 136 |
| 137 bool GetCurrentTabTitle(const Browser* browser, base::string16* title) { | 137 bool GetCurrentTabTitle(const Browser* browser, base::string16* title) { |
| 138 WebContents* web_contents = | 138 WebContents* web_contents = |
| 139 browser->tab_strip_model()->GetActiveWebContents(); | 139 browser->tab_strip_model()->GetActiveWebContents(); |
| 140 if (!web_contents) | 140 if (!web_contents) |
| 141 return false; | 141 return false; |
| 142 NavigationEntry* last_entry = web_contents->GetController().GetActiveEntry(); | 142 NavigationEntry* last_entry = web_contents->GetController().GetActiveEntry(); |
| 143 if (!last_entry) | 143 if (!last_entry) |
| 144 return false; | 144 return false; |
| 145 title->assign(last_entry->GetTitleForDisplay(std::string())); | 145 title->assign(last_entry->GetTitleForDisplay()); |
| 146 return true; | 146 return true; |
| 147 } | 147 } |
| 148 | 148 |
| 149 void NavigateToURL(chrome::NavigateParams* params) { | 149 void NavigateToURL(chrome::NavigateParams* params) { |
| 150 chrome::Navigate(params); | 150 chrome::Navigate(params); |
| 151 content::WaitForLoadStop(params->target_contents); | 151 content::WaitForLoadStop(params->target_contents); |
| 152 } | 152 } |
| 153 | 153 |
| 154 void NavigateToURLWithPost(Browser* browser, const GURL& url) { | 154 void NavigateToURLWithPost(Browser* browser, const GURL& url) { |
| 155 chrome::NavigateParams params(browser, url, | 155 chrome::NavigateParams params(browser, url, |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 new content::MessageLoopRunner; | 529 new content::MessageLoopRunner; |
| 530 WaitHistoryLoadedObserver observer(runner.get()); | 530 WaitHistoryLoadedObserver observer(runner.get()); |
| 531 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> | 531 ScopedObserver<history::HistoryService, history::HistoryServiceObserver> |
| 532 scoped_observer(&observer); | 532 scoped_observer(&observer); |
| 533 scoped_observer.Add(history_service); | 533 scoped_observer.Add(history_service); |
| 534 runner->Run(); | 534 runner->Run(); |
| 535 } | 535 } |
| 536 } | 536 } |
| 537 | 537 |
| 538 } // namespace ui_test_utils | 538 } // namespace ui_test_utils |
| OLD | NEW |