OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui_test_utils.h" | 5 #include "chrome/test/ui_test_utils.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 ui_test_utils::RunMessageLoop(); | 392 ui_test_utils::RunMessageLoop(); |
393 } | 393 } |
394 | 394 |
395 bool GetCurrentTabTitle(const Browser* browser, string16* title) { | 395 bool GetCurrentTabTitle(const Browser* browser, string16* title) { |
396 TabContents* tab_contents = browser->GetSelectedTabContents(); | 396 TabContents* tab_contents = browser->GetSelectedTabContents(); |
397 if (!tab_contents) | 397 if (!tab_contents) |
398 return false; | 398 return false; |
399 NavigationEntry* last_entry = tab_contents->controller().GetActiveEntry(); | 399 NavigationEntry* last_entry = tab_contents->controller().GetActiveEntry(); |
400 if (!last_entry) | 400 if (!last_entry) |
401 return false; | 401 return false; |
402 // TODO(evan): use directionality of title. | 402 title->assign(last_entry->GetTitleForDisplay("")); |
403 // http://code.google.com/p/chromium/issues/detail?id=27094 | |
404 title->assign(last_entry->GetTitleForDisplay("").string()); | |
405 return true; | 403 return true; |
406 } | 404 } |
407 | 405 |
408 bool WaitForNavigationInCurrentTab(Browser* browser) { | 406 bool WaitForNavigationInCurrentTab(Browser* browser) { |
409 TabContents* tab_contents = browser->GetSelectedTabContents(); | 407 TabContents* tab_contents = browser->GetSelectedTabContents(); |
410 if (!tab_contents) | 408 if (!tab_contents) |
411 return false; | 409 return false; |
412 WaitForNavigation(&tab_contents->controller()); | 410 WaitForNavigation(&tab_contents->controller()); |
413 return true; | 411 return true; |
414 } | 412 } |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1072 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); | 1070 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); |
1073 } | 1071 } |
1074 | 1072 |
1075 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { | 1073 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { |
1076 DCHECK(bitmap); | 1074 DCHECK(bitmap); |
1077 SnapshotTaker taker; | 1075 SnapshotTaker taker; |
1078 return taker.TakeEntirePageSnapshot(rvh, bitmap); | 1076 return taker.TakeEntirePageSnapshot(rvh, bitmap); |
1079 } | 1077 } |
1080 | 1078 |
1081 } // namespace ui_test_utils | 1079 } // namespace ui_test_utils |
OLD | NEW |