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

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

Issue 473: Readding UI test I pulled yesterday; hopefully the bots will like it more now... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 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
« no previous file with comments | « chrome/test/ui/ui_test.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 return false; // Some error. 369 return false; // Some error.
370 if (visible) 370 if (visible)
371 return true; // Find window is visible. 371 return true; // Find window is visible.
372 372
373 // Give it a chance to catch up. 373 // Give it a chance to catch up.
374 Sleep(kWaitForActionMaxMsec / kCycles); 374 Sleep(kWaitForActionMaxMsec / kCycles);
375 } 375 }
376 return false; 376 return false;
377 } 377 }
378 378
379 bool UITest::WaitForBookmarkBarVisibilityChange(BrowserProxy* browser,
380 bool wait_for_open) {
381 const int kCycles = 20;
382 for (int i = 0; i < kCycles; i++) {
383 bool visible = false;
384 bool animating = true;
385 if (!browser->GetBookmarkBarVisibility(&visible, &animating))
386 return false; // Some error.
387 if (visible == wait_for_open && !animating)
388 return true; // Bookmark bar visibility change complete.
389
390 // Give it a chance to catch up.
391 Sleep(kWaitForActionMaxMsec / kCycles);
392 }
393 return false;
394 }
395
379 GURL UITest::GetActiveTabURL() { 396 GURL UITest::GetActiveTabURL() {
380 scoped_ptr<TabProxy> tab_proxy(GetActiveTab()); 397 scoped_ptr<TabProxy> tab_proxy(GetActiveTab());
381 if (!tab_proxy.get()) 398 if (!tab_proxy.get())
382 return GURL(); 399 return GURL();
383 400
384 GURL url; 401 GURL url;
385 if (!tab_proxy->GetCurrentURL(&url)) 402 if (!tab_proxy->GetCurrentURL(&url))
386 return GURL(); 403 return GURL();
387 return url; 404 return url;
388 } 405 }
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 size_t value, 576 size_t value,
560 const std::wstring& units, 577 const std::wstring& units,
561 bool important) { 578 bool important) {
562 wprintf(L"%lsRESULT %ls%ls: %ls= %d %ls\n", 579 wprintf(L"%lsRESULT %ls%ls: %ls= %d %ls\n",
563 important ? L"*" : L"", measurement.c_str(), modifier.c_str(), 580 important ? L"*" : L"", measurement.c_str(), modifier.c_str(),
564 trace.c_str(), value, units.c_str()); 581 trace.c_str(), value, units.c_str());
565 } 582 }
566 583
567 584
568 585
OLDNEW
« no previous file with comments | « chrome/test/ui/ui_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698