| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/ui_test.h" | 5 #include "chrome/test/ui/ui_test.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 | 493 |
| 494 bool visible = !wait_for_open; | 494 bool visible = !wait_for_open; |
| 495 if (!browser->IsShelfVisible(&visible)) | 495 if (!browser->IsShelfVisible(&visible)) |
| 496 continue; | 496 continue; |
| 497 if (visible == wait_for_open) | 497 if (visible == wait_for_open) |
| 498 return true; // Got the download shelf. | 498 return true; // Got the download shelf. |
| 499 } | 499 } |
| 500 return false; | 500 return false; |
| 501 } | 501 } |
| 502 | 502 |
| 503 // TODO(port): this #if effectively cuts out half of this file on |
| 504 // non-Windows platforms, and is a temporary hack to get things |
| 505 // building. |
| 506 #if defined(OS_WIN) |
| 503 bool UITest::WaitForFindWindowVisibilityChange(BrowserProxy* browser, | 507 bool UITest::WaitForFindWindowVisibilityChange(BrowserProxy* browser, |
| 504 bool wait_for_open) { | 508 bool wait_for_open) { |
| 505 const int kCycles = 10; | 509 const int kCycles = 10; |
| 506 for (int i = 0; i < kCycles; i++) { | 510 for (int i = 0; i < kCycles; i++) { |
| 507 bool visible = false; | 511 bool visible = false; |
| 508 if (!browser->IsFindWindowFullyVisible(&visible)) | 512 if (!browser->IsFindWindowFullyVisible(&visible)) |
| 509 return false; // Some error. | 513 return false; // Some error. |
| 510 if (visible == wait_for_open) | 514 if (visible == wait_for_open) |
| 511 return true; // Find window visibility change complete. | 515 return true; // Find window visibility change complete. |
| 512 | 516 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 525 if (!browser->GetBookmarkBarVisibility(&visible, &animating)) | 529 if (!browser->GetBookmarkBarVisibility(&visible, &animating)) |
| 526 return false; // Some error. | 530 return false; // Some error. |
| 527 if (visible == wait_for_open && !animating) | 531 if (visible == wait_for_open && !animating) |
| 528 return true; // Bookmark bar visibility change complete. | 532 return true; // Bookmark bar visibility change complete. |
| 529 | 533 |
| 530 // Give it a chance to catch up. | 534 // Give it a chance to catch up. |
| 531 PlatformThread::Sleep(sleep_timeout_ms() / kCycles); | 535 PlatformThread::Sleep(sleep_timeout_ms() / kCycles); |
| 532 } | 536 } |
| 533 return false; | 537 return false; |
| 534 } | 538 } |
| 539 #endif // defined(OS_WIN) |
| 535 | 540 |
| 536 GURL UITest::GetActiveTabURL(int window_index) { | 541 GURL UITest::GetActiveTabURL(int window_index) { |
| 537 scoped_refptr<TabProxy> tab_proxy(GetActiveTab(window_index)); | 542 scoped_refptr<TabProxy> tab_proxy(GetActiveTab(window_index)); |
| 538 if (!tab_proxy.get()) | 543 if (!tab_proxy.get()) |
| 539 return GURL(); | 544 return GURL(); |
| 540 | 545 |
| 541 GURL url; | 546 GURL url; |
| 542 if (!tab_proxy->GetCurrentURL(&url)) | 547 if (!tab_proxy->GetCurrentURL(&url)) |
| 543 return GURL(); | 548 return GURL(); |
| 544 return url; | 549 return url; |
| (...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1102 #else | 1107 #else |
| 1103 // TODO(port): above code is very Windows-specific; we need to | 1108 // TODO(port): above code is very Windows-specific; we need to |
| 1104 // figure out and abstract out how we'll handle finding any existing | 1109 // figure out and abstract out how we'll handle finding any existing |
| 1105 // running process, etc. on other platforms. | 1110 // running process, etc. on other platforms. |
| 1106 NOTIMPLEMENTED(); | 1111 NOTIMPLEMENTED(); |
| 1107 #endif | 1112 #endif |
| 1108 } | 1113 } |
| 1109 | 1114 |
| 1110 return true; | 1115 return true; |
| 1111 } | 1116 } |
| OLD | NEW |