Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: chrome/test/ui/ui_test.cc

Issue 196096: First part of automated_ui_tests improvements.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: disable on lin/mac Created 11 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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)
507 bool UITest::WaitForFindWindowVisibilityChange(BrowserProxy* browser, 503 bool UITest::WaitForFindWindowVisibilityChange(BrowserProxy* browser,
508 bool wait_for_open) { 504 bool wait_for_open) {
509 const int kCycles = 10; 505 const int kCycles = 10;
510 for (int i = 0; i < kCycles; i++) { 506 for (int i = 0; i < kCycles; i++) {
511 bool visible = false; 507 bool visible = false;
512 if (!browser->IsFindWindowFullyVisible(&visible)) 508 if (!browser->IsFindWindowFullyVisible(&visible))
513 return false; // Some error. 509 return false; // Some error.
514 if (visible == wait_for_open) 510 if (visible == wait_for_open)
515 return true; // Find window visibility change complete. 511 return true; // Find window visibility change complete.
516 512
(...skipping 12 matching lines...) Expand all
529 if (!browser->GetBookmarkBarVisibility(&visible, &animating)) 525 if (!browser->GetBookmarkBarVisibility(&visible, &animating))
530 return false; // Some error. 526 return false; // Some error.
531 if (visible == wait_for_open && !animating) 527 if (visible == wait_for_open && !animating)
532 return true; // Bookmark bar visibility change complete. 528 return true; // Bookmark bar visibility change complete.
533 529
534 // Give it a chance to catch up. 530 // Give it a chance to catch up.
535 PlatformThread::Sleep(sleep_timeout_ms() / kCycles); 531 PlatformThread::Sleep(sleep_timeout_ms() / kCycles);
536 } 532 }
537 return false; 533 return false;
538 } 534 }
539 #endif // defined(OS_WIN)
540 535
541 GURL UITest::GetActiveTabURL(int window_index) { 536 GURL UITest::GetActiveTabURL(int window_index) {
542 scoped_refptr<TabProxy> tab_proxy(GetActiveTab(window_index)); 537 scoped_refptr<TabProxy> tab_proxy(GetActiveTab(window_index));
543 if (!tab_proxy.get()) 538 if (!tab_proxy.get())
544 return GURL(); 539 return GURL();
545 540
546 GURL url; 541 GURL url;
547 if (!tab_proxy->GetCurrentURL(&url)) 542 if (!tab_proxy->GetCurrentURL(&url))
548 return GURL(); 543 return GURL();
549 return url; 544 return url;
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1107 #else 1102 #else
1108 // TODO(port): above code is very Windows-specific; we need to 1103 // TODO(port): above code is very Windows-specific; we need to
1109 // figure out and abstract out how we'll handle finding any existing 1104 // figure out and abstract out how we'll handle finding any existing
1110 // running process, etc. on other platforms. 1105 // running process, etc. on other platforms.
1111 NOTIMPLEMENTED(); 1106 NOTIMPLEMENTED();
1112 #endif 1107 #endif
1113 } 1108 }
1114 1109
1115 return true; 1110 return true;
1116 } 1111 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698