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

Side by Side Diff: chrome/utility/cloud_print/pwg_encoder_unittest.cc

Issue 214243006: Minimal patch to add rotation to PWG raster generation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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/utility/cloud_print/pwg_encoder.cc ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/file_util.h" 5 #include "base/file_util.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/sha1.h" 7 #include "base/sha1.h"
8 #include "chrome/utility/cloud_print/bitmap_image.h" 8 #include "chrome/utility/cloud_print/bitmap_image.h"
9 #include "chrome/utility/cloud_print/pwg_encoder.h" 9 #include "chrome/utility/cloud_print/pwg_encoder.h"
10 #include "testing/gtest/include/gtest/gtest.h" 10 #include "testing/gtest/include/gtest/gtest.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 bitmap_data[row_start + i] = 255 << 16; 56 bitmap_data[row_start + i] = 255 << 16;
57 } 57 }
58 } 58 }
59 } 59 }
60 60
61 return bitmap_image.Pass(); 61 return bitmap_image.Pass();
62 } 62 }
63 63
64 } // namespace 64 } // namespace
65 65
66 // TODO(noamsml): Add tests for rotated cases.
66 TEST(PwgRasterTest, CompareWithMaster) { 67 TEST(PwgRasterTest, CompareWithMaster) {
67 std::string output; 68 std::string output;
68 PwgEncoder encoder; 69 PwgEncoder encoder;
69 scoped_ptr<BitmapImage> image = MakeSampleBitmap(); 70 scoped_ptr<BitmapImage> image = MakeSampleBitmap();
70 71
71 encoder.EncodeDocumentHeader(&output); 72 encoder.EncodeDocumentHeader(&output);
72 encoder.EncodePage(*image, kRasterDPI, 1, &output); 73 encoder.EncodePage(*image, kRasterDPI, 1, &output, false);
73 74
74 EXPECT_EQ(kPWGFileSha1, base::SHA1HashString(output)); 75 EXPECT_EQ(kPWGFileSha1, base::SHA1HashString(output));
75 } 76 }
76 77
77 } // namespace cloud_print 78 } // namespace cloud_print
78
OLDNEW
« no previous file with comments | « chrome/utility/cloud_print/pwg_encoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698