OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
491 ASSERT_FALSE(is_timeout) << url.spec(); | 491 ASSERT_FALSE(is_timeout) << url.spec(); |
492 } | 492 } |
493 | 493 |
494 // TODO(port): this #if effectively cuts out half of this file on | 494 // TODO(port): this #if effectively cuts out half of this file on |
495 // non-Windows platforms, and is a temporary hack to get things | 495 // non-Windows platforms, and is a temporary hack to get things |
496 // building. | 496 // building. |
497 #if defined(OS_WIN) | 497 #if defined(OS_WIN) |
498 bool UITest::WaitForDownloadShelfVisible(TabProxy* tab) { | 498 bool UITest::WaitForDownloadShelfVisible(TabProxy* tab) { |
499 const int kCycles = 20; | 499 const int kCycles = 20; |
500 for (int i = 0; i < kCycles; i++) { | 500 for (int i = 0; i < kCycles; i++) { |
| 501 // Give it a chance to catch up. |
| 502 PlatformThread::Sleep(action_max_timeout_ms() / kCycles); |
| 503 |
501 bool visible = false; | 504 bool visible = false; |
502 if (!tab->IsShelfVisible(&visible)) | 505 if (!tab->IsShelfVisible(&visible)) |
503 return false; // Some error. | 506 continue; |
504 if (visible) | 507 if (visible) |
505 return true; // Got the download shelf. | 508 return true; // Got the download shelf. |
506 | |
507 // Give it a chance to catch up. | |
508 PlatformThread::Sleep(action_max_timeout_ms() / kCycles); | |
509 } | 509 } |
510 return false; | 510 return false; |
511 } | 511 } |
512 | 512 |
513 bool UITest::WaitForFindWindowVisibilityChange(BrowserProxy* browser, | 513 bool UITest::WaitForFindWindowVisibilityChange(BrowserProxy* browser, |
514 bool wait_for_open) { | 514 bool wait_for_open) { |
515 const int kCycles = 20; | 515 const int kCycles = 20; |
516 for (int i = 0; i < kCycles; i++) { | 516 for (int i = 0; i < kCycles; i++) { |
517 bool visible = false; | 517 bool visible = false; |
518 if (!browser->IsFindWindowFullyVisible(&visible)) | 518 if (!browser->IsFindWindowFullyVisible(&visible)) |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 const std::wstring& units, | 798 const std::wstring& units, |
799 bool important) { | 799 bool important) { |
800 // <*>RESULT <graph_name>: <trace_name>= <value> <units> | 800 // <*>RESULT <graph_name>: <trace_name>= <value> <units> |
801 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> | 801 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> |
802 // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units> | 802 // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units> |
803 wprintf(L"%lsRESULT %ls%ls: %ls= %ls%ls%ls %ls\n", | 803 wprintf(L"%lsRESULT %ls%ls: %ls= %ls%ls%ls %ls\n", |
804 important ? L"*" : L"", measurement.c_str(), modifier.c_str(), | 804 important ? L"*" : L"", measurement.c_str(), modifier.c_str(), |
805 trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(), | 805 trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(), |
806 units.c_str()); | 806 units.c_str()); |
807 } | 807 } |
OLD | NEW |