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

Side by Side Diff: content/test/render_widget_browsertest.h

Issue 10492009: Move test headers from content\test to content\public\test. This way we can enforce that internal c… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac Created 8 years, 6 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
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_TEST_RENDER_WIDGET_BROWSERTEST_H_
6 #define CONTENT_TEST_RENDER_WIDGET_BROWSERTEST_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/file_path.h"
11 #include "content/test/render_view_test.h"
12
13 class SkBitmap;
14
15 namespace gfx {
16 class Size;
17 }
18
19 class RenderWidgetTest : public content::RenderViewTest {
20 public:
21 RenderWidgetTest();
22
23 protected:
24 static const int kNumBytesPerPixel;
25 static const int kLargeWidth;
26 static const int kLargeHeight;
27 static const int kSmallWidth;
28 static const int kSmallHeight;
29 static const int kTextPositionX;
30 static const int kTextPositionY;
31 static const uint32 kRedARGB;
32
33 // Helper function which calls OnMsgPaintAtSize and also paints the result
34 // in the given bitmap. The widget is resized to |page_size| before we paint
35 // and the final image is resized to |desired_size|. This method is virtual so
36 // that TestResizeAndPaint() can be reused by subclasses of this test class.
37 virtual void ResizeAndPaint(const gfx::Size& page_size,
38 const gfx::Size& desired_size,
39 SkBitmap* snapshot);
40
41 // Test for ResizeAndPaint.
42 void TestResizeAndPaint();
43
44 // Helper function which returns true if the given bitmap contains the given
45 // ARGB color and false otherwise.
46 bool ImageContainsColor(const SkBitmap& bitmap, uint32 argb_color);
47
48 // This can be used for debugging if you want to output a bitmap
49 // image to a file.
50 // FilePath tmp_path;
51 // file_util::CreateTemporaryFile(&tmp_path);
52 // OutputBitmapToFile(bitmap, tmp_path);
53 // LOG(INFO) << "Bitmap image stored at: " << tmp_path.value();
54 void OutputBitmapToFile(const SkBitmap& bitmap, const FilePath& file_path);
55 };
56
57 #endif // CONTENT_TEST_RENDER_WIDGET_BROWSERTEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698