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/reliability/automated_ui_test_base.h" | 5 #include "chrome/test/reliability/automated_ui_test_base.h" |
6 | 6 |
7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/ui/view_ids.h" | 9 #include "chrome/browser/ui/view_ids.h" |
10 #include "chrome/test/automation/automation_proxy.h" | 10 #include "chrome/test/automation/automation_proxy.h" |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 } | 310 } |
311 | 311 |
312 bool AutomatedUITestBase::SelectNextTab() { | 312 bool AutomatedUITestBase::SelectNextTab() { |
313 return RunCommand(IDC_SELECT_NEXT_TAB); | 313 return RunCommand(IDC_SELECT_NEXT_TAB); |
314 } | 314 } |
315 | 315 |
316 bool AutomatedUITestBase::SelectPreviousTab() { | 316 bool AutomatedUITestBase::SelectPreviousTab() { |
317 return RunCommand(IDC_SELECT_PREVIOUS_TAB); | 317 return RunCommand(IDC_SELECT_PREVIOUS_TAB); |
318 } | 318 } |
319 | 319 |
320 bool AutomatedUITestBase::ShowBookmarkBar() { | |
321 bool is_visible; | |
322 bool is_animating; | |
323 bool is_detached; | |
324 if (!active_browser()->GetBookmarkBarVisibility(&is_visible, | |
325 &is_animating, | |
326 &is_detached)) { | |
327 return false; | |
328 } | |
329 | |
330 if (is_visible) { | |
331 // If the bar is visible, then issuing the command again will toggle it. | |
332 return true; | |
333 } | |
334 | |
335 if (!RunCommandAsync(IDC_SHOW_BOOKMARK_BAR)) | |
336 return false; | |
337 | |
338 return WaitForBookmarkBarVisibilityChange(active_browser(), true); | |
339 } | |
340 | |
341 bool AutomatedUITestBase::ShowDownloads() { | 320 bool AutomatedUITestBase::ShowDownloads() { |
342 return RunCommand(IDC_SHOW_DOWNLOADS); | 321 return RunCommand(IDC_SHOW_DOWNLOADS); |
343 } | 322 } |
344 | 323 |
345 bool AutomatedUITestBase::ShowHistory() { | 324 bool AutomatedUITestBase::ShowHistory() { |
346 return RunCommand(IDC_SHOW_HISTORY); | 325 return RunCommand(IDC_SHOW_HISTORY); |
347 } | 326 } |
348 | 327 |
349 bool AutomatedUITestBase::RunCommandAsync(int browser_command) { | 328 bool AutomatedUITestBase::RunCommandAsync(int browser_command) { |
350 BrowserProxy* browser = active_browser(); | 329 BrowserProxy* browser = active_browser(); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 | 365 |
387 scoped_refptr<WindowProxy> AutomatedUITestBase::GetAndActivateWindowForBrowser( | 366 scoped_refptr<WindowProxy> AutomatedUITestBase::GetAndActivateWindowForBrowser( |
388 BrowserProxy* browser) { | 367 BrowserProxy* browser) { |
389 if (!browser->BringToFront()) { | 368 if (!browser->BringToFront()) { |
390 LogWarningMessage("failed_to_bring_window_to_front"); | 369 LogWarningMessage("failed_to_bring_window_to_front"); |
391 return NULL; | 370 return NULL; |
392 } | 371 } |
393 | 372 |
394 return browser->GetWindow(); | 373 return browser->GetWindow(); |
395 } | 374 } |
OLD | NEW |