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

Unified Diff: ui/ozone/platform/test/test_window_manager.cc

Issue 419993003: Adds a do-nothing ozone platform (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds a do-nothing ozone platform when --ozone-dump-file is not specified (rebased) Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/platform/test/test_window.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/test/test_window_manager.cc
diff --git a/ui/ozone/platform/test/test_window_manager.cc b/ui/ozone/platform/test/test_window_manager.cc
index 8e6e4b02b1a0e3640618e9d1ff03e3b2fdcfa193..ef9cc1f41538bd47e83c9ecbac31483502ca804a 100644
--- a/ui/ozone/platform/test/test_window_manager.cc
+++ b/ui/ozone/platform/test/test_window_manager.cc
@@ -21,6 +21,7 @@ namespace ui {
namespace {
void WriteDataToFile(const base::FilePath& location, const SkBitmap& bitmap) {
+ DCHECK(!location.empty());
std::vector<unsigned char> png_data;
gfx::PNGCodec::FastEncodeBGRASkBitmap(bitmap, true, &png_data);
base::WriteFile(location,
@@ -42,6 +43,8 @@ class FileSurface : public SurfaceOzoneCanvas {
return skia::SharePtr(surface_->getCanvas());
}
virtual void PresentCanvas(const gfx::Rect& damage) OVERRIDE {
+ if (location_.empty())
+ return;
SkBitmap bitmap;
bitmap.setInfo(surface_->getCanvas()->imageInfo());
@@ -71,6 +74,8 @@ TestWindowManager::~TestWindowManager() {
}
void TestWindowManager::Initialize() {
+ if (location_.empty())
+ return;
if (!DirectoryExists(location_) && !base::CreateDirectory(location_) &&
location_ != base::FilePath("/dev/null"))
PLOG(FATAL) << "unable to create output directory";
« no previous file with comments | « ui/ozone/platform/test/test_window.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698