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

Side by Side Diff: chrome/test/base/ui_test_utils.cc

Issue 184563006: Move WriteFile and WriteFileDescriptor from file_util to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/base/ui_test_utils.h" 5 #include "chrome/test/base/ui_test_utils.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 HMONITOR main_monitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY); 480 HMONITOR main_monitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY);
481 if (GetMonitorInfo(main_monitor, &monitor_info)) { 481 if (GetMonitorInfo(main_monitor, &monitor_info)) {
482 RECT& rect = monitor_info.rcMonitor; 482 RECT& rect = monitor_info.rcMonitor;
483 483
484 std::vector<unsigned char> png_data; 484 std::vector<unsigned char> png_data;
485 gfx::Rect bounds( 485 gfx::Rect bounds(
486 gfx::Size(rect.right - rect.left, rect.bottom - rect.top)); 486 gfx::Size(rect.right - rect.left, rect.bottom - rect.top));
487 if (ui::GrabDesktopSnapshot(bounds, &png_data) && 487 if (ui::GrabDesktopSnapshot(bounds, &png_data) &&
488 png_data.size() <= INT_MAX) { 488 png_data.size() <= INT_MAX) {
489 int bytes = static_cast<int>(png_data.size()); 489 int bytes = static_cast<int>(png_data.size());
490 int written = file_util::WriteFile( 490 int written = base::WriteFile(
491 out_path, reinterpret_cast<char*>(&png_data[0]), bytes); 491 out_path, reinterpret_cast<char*>(&png_data[0]), bytes);
492 succeeded = (written == bytes); 492 succeeded = (written == bytes);
493 } 493 }
494 } 494 }
495 495
496 if (succeeded && screenshot_path != NULL) 496 if (succeeded && screenshot_path != NULL)
497 *screenshot_path = out_path; 497 *screenshot_path = out_path;
498 498
499 return succeeded; 499 return succeeded;
500 } 500 }
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 void HistoryEnumerator::HistoryQueryComplete( 544 void HistoryEnumerator::HistoryQueryComplete(
545 const base::Closure& quit_task, 545 const base::Closure& quit_task,
546 HistoryService::Handle request_handle, 546 HistoryService::Handle request_handle,
547 history::QueryResults* results) { 547 history::QueryResults* results) {
548 for (size_t i = 0; i < results->size(); ++i) 548 for (size_t i = 0; i < results->size(); ++i)
549 urls_.push_back((*results)[i].url()); 549 urls_.push_back((*results)[i].url());
550 quit_task.Run(); 550 quit_task.Run();
551 } 551 }
552 552
553 } // namespace ui_test_utils 553 } // namespace ui_test_utils
OLDNEW
« no previous file with comments | « chrome/service/cloud_print/printer_job_handler.cc ('k') | chrome/test/chromedriver/chrome/zip_reader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698