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

Unified Diff: chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc

Issue 159891: Make the DOMUIThemeSource load and pass through a PNG, rather than relying on... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 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 | « chrome/browser/dom_ui/dom_ui_theme_source.cc ('k') | views/widget/default_theme_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc
===================================================================
--- chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc (revision 22426)
+++ chrome/browser/dom_ui/dom_ui_theme_source_unittest.cc (working copy)
@@ -17,7 +17,7 @@
explicit MockThemeSource(Profile* profile)
: DOMUIThemeSource(profile),
result_request_id_(-1),
- result_data_size_(0) {
+ result_data_size_(0) {
}
virtual void SendResponse(int request_id, RefCountedBytes* data) {
@@ -56,20 +56,16 @@
}
TEST_F(DOMUISourcesTest, ThemeSourceImages) {
- // Our test data. Rather than comparing the data itself, we just compare
- // its size.
- SkBitmap* image = ResourceBundle::GetSharedInstance().GetBitmapNamed(
- IDR_THEME_FRAME_INCOGNITO);
- std::vector<unsigned char> png_bytes;
- PNGEncoder::EncodeBGRASkBitmap(*image, false, &png_bytes);
-
+ // We used to PNGEncode the images ourselves, but encoder differences
+ // invalidated that. We now just check that the image exists.
theme_source()->StartDataRequest("theme_frame_incognito", 1);
+ size_t min = 0;
EXPECT_EQ(theme_source()->result_request_id_, 1);
- EXPECT_EQ(theme_source()->result_data_size_, png_bytes.size());
+ EXPECT_GT(theme_source()->result_data_size_, min);
theme_source()->StartDataRequest("theme_toolbar", 2);
EXPECT_EQ(theme_source()->result_request_id_, 2);
- EXPECT_NE(theme_source()->result_data_size_, png_bytes.size());
+ EXPECT_GT(theme_source()->result_data_size_, min);
}
TEST_F(DOMUISourcesTest, ThemeSourceCSS) {
« no previous file with comments | « chrome/browser/dom_ui/dom_ui_theme_source.cc ('k') | views/widget/default_theme_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698