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 <set> | 5 #include <set> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "chrome/test/ui/ui_test.h" | 8 #include "chrome/test/ui/ui_test.h" |
9 | 9 |
10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 return false; // Some error. | 382 return false; // Some error. |
383 if (visible) | 383 if (visible) |
384 return true; // Got the download shelf. | 384 return true; // Got the download shelf. |
385 | 385 |
386 // Give it a chance to catch up. | 386 // Give it a chance to catch up. |
387 Sleep(kWaitForActionMaxMsec / kCycles); | 387 Sleep(kWaitForActionMaxMsec / kCycles); |
388 } | 388 } |
389 return false; | 389 return false; |
390 } | 390 } |
391 | 391 |
392 bool UITest::WaitForFindWindowFullyVisible(TabProxy* tab) { | 392 bool UITest::WaitForFindWindowVisibilityChange(TabProxy* tab, |
| 393 bool wait_for_open) { |
393 const int kCycles = 20; | 394 const int kCycles = 20; |
394 for (int i = 0; i < kCycles; i++) { | 395 for (int i = 0; i < kCycles; i++) { |
395 bool visible = false; | 396 bool visible = false; |
396 if (!tab->IsFindWindowFullyVisible(&visible)) | 397 if (!tab->IsFindWindowFullyVisible(&visible)) |
397 return false; // Some error. | 398 return false; // Some error. |
398 if (visible) | 399 if (visible == wait_for_open) |
399 return true; // Find window is visible. | 400 return true; // Find window visibility change complete. |
400 | 401 |
401 // Give it a chance to catch up. | 402 // Give it a chance to catch up. |
402 Sleep(kWaitForActionMaxMsec / kCycles); | 403 Sleep(kWaitForActionMaxMsec / kCycles); |
403 } | 404 } |
404 return false; | 405 return false; |
405 } | 406 } |
406 | 407 |
407 bool UITest::WaitForBookmarkBarVisibilityChange(BrowserProxy* browser, | 408 bool UITest::WaitForBookmarkBarVisibilityChange(BrowserProxy* browser, |
408 bool wait_for_open) { | 409 bool wait_for_open) { |
409 const int kCycles = 20; | 410 const int kCycles = 20; |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 const std::wstring& units, | 675 const std::wstring& units, |
675 bool important) { | 676 bool important) { |
676 // <*>RESULT <graph_name>: <trace_name>= <value> <units> | 677 // <*>RESULT <graph_name>: <trace_name>= <value> <units> |
677 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> | 678 // <*>RESULT <graph_name>: <trace_name>= {<mean>, <std deviation>} <units> |
678 // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units> | 679 // <*>RESULT <graph_name>: <trace_name>= [<value>,value,value,...,] <units> |
679 wprintf(L"%lsRESULT %ls%ls: %ls= %ls%ls%ls %ls\n", | 680 wprintf(L"%lsRESULT %ls%ls: %ls= %ls%ls%ls %ls\n", |
680 important ? L"*" : L"", measurement.c_str(), modifier.c_str(), | 681 important ? L"*" : L"", measurement.c_str(), modifier.c_str(), |
681 trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(), | 682 trace.c_str(), prefix.c_str(), values.c_str(), suffix.c_str(), |
682 units.c_str()); | 683 units.c_str()); |
683 } | 684 } |
OLD | NEW |