| 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/base/ui_test_utils.h" | 5 #include "chrome/test/base/ui_test_utils.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 #include "ui/gfx/size.h" | 61 #include "ui/gfx/size.h" |
| 62 | 62 |
| 63 #if defined(TOOLKIT_VIEWS) | 63 #if defined(TOOLKIT_VIEWS) |
| 64 #include "ui/views/focus/accelerator_handler.h" | 64 #include "ui/views/focus/accelerator_handler.h" |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 #if defined(USE_AURA) | 67 #if defined(USE_AURA) |
| 68 #include "ui/aura/root_window.h" | 68 #include "ui/aura/root_window.h" |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 using content::NavigationEntry; |
| 71 using content::OpenURLParams; | 72 using content::OpenURLParams; |
| 72 using content::Referrer; | 73 using content::Referrer; |
| 73 using content::WebContents; | 74 using content::WebContents; |
| 74 | 75 |
| 75 static const int kDefaultWsPort = 8880; | 76 static const int kDefaultWsPort = 8880; |
| 76 | 77 |
| 77 namespace ui_test_utils { | 78 namespace ui_test_utils { |
| 78 | 79 |
| 79 namespace { | 80 namespace { |
| 80 | 81 |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 content::BrowserThread::PostTask(thread_id, FROM_HERE, | 300 content::BrowserThread::PostTask(thread_id, FROM_HERE, |
| 300 base::Bind(&RunAllPendingMessageAndSendQuit, current_thread_id)); | 301 base::Bind(&RunAllPendingMessageAndSendQuit, current_thread_id)); |
| 301 | 302 |
| 302 ui_test_utils::RunMessageLoop(); | 303 ui_test_utils::RunMessageLoop(); |
| 303 } | 304 } |
| 304 | 305 |
| 305 bool GetCurrentTabTitle(const Browser* browser, string16* title) { | 306 bool GetCurrentTabTitle(const Browser* browser, string16* title) { |
| 306 TabContents* tab_contents = browser->GetSelectedTabContents(); | 307 TabContents* tab_contents = browser->GetSelectedTabContents(); |
| 307 if (!tab_contents) | 308 if (!tab_contents) |
| 308 return false; | 309 return false; |
| 309 content::NavigationEntry* last_entry = | 310 NavigationEntry* last_entry = tab_contents->GetController().GetActiveEntry(); |
| 310 tab_contents->GetController().GetActiveEntry(); | |
| 311 if (!last_entry) | 311 if (!last_entry) |
| 312 return false; | 312 return false; |
| 313 title->assign(last_entry->GetTitleForDisplay("")); | 313 title->assign(last_entry->GetTitleForDisplay("")); |
| 314 return true; | 314 return true; |
| 315 } | 315 } |
| 316 | 316 |
| 317 void WaitForNavigations(NavigationController* controller, | 317 void WaitForNavigations(NavigationController* controller, |
| 318 int number_of_navigations) { | 318 int number_of_navigations) { |
| 319 TestNavigationObserver observer( | 319 TestNavigationObserver observer( |
| 320 content::Source<NavigationController>(controller), NULL, | 320 content::Source<NavigationController>(controller), NULL, |
| (...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1078 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); | 1078 return taker.TakeRenderWidgetSnapshot(rwh, page_size, page_size, bitmap); |
| 1079 } | 1079 } |
| 1080 | 1080 |
| 1081 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { | 1081 bool TakeEntirePageSnapshot(RenderViewHost* rvh, SkBitmap* bitmap) { |
| 1082 DCHECK(bitmap); | 1082 DCHECK(bitmap); |
| 1083 SnapshotTaker taker; | 1083 SnapshotTaker taker; |
| 1084 return taker.TakeEntirePageSnapshot(rvh, bitmap); | 1084 return taker.TakeEntirePageSnapshot(rvh, bitmap); |
| 1085 } | 1085 } |
| 1086 | 1086 |
| 1087 } // namespace ui_test_utils | 1087 } // namespace ui_test_utils |
| OLD | NEW |