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

Side by Side Diff: chrome/browser/themes/browser_theme_pack_unittest.cc

Issue 453213002: IDR_THEME_TAB_BACKGROUND_INCOGNITO should not be defined on Mac. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.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 (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/browser/themes/browser_theme_pack.h" 5 #include "chrome/browser/themes/browser_theme_pack.h"
6 6
7 #include "base/files/scoped_temp_dir.h" 7 #include "base/files/scoped_temp_dir.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND)); 233 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND));
234 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_TOOLBAR)); 234 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_TOOLBAR));
235 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_WINDOW_CONTROL_BACKGROUND)); 235 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_WINDOW_CONTROL_BACKGROUND));
236 236
237 // Here are a few images that we shouldn't expect because even though 237 // Here are a few images that we shouldn't expect because even though
238 // they're included in the theme pack, they were autogenerated and 238 // they're included in the theme pack, they were autogenerated and
239 // therefore shouldn't show up when calling HasCustomImage(). 239 // therefore shouldn't show up when calling HasCustomImage().
240 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INACTIVE)); 240 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INACTIVE));
241 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); 241 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO));
242 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO_INACTIVE)); 242 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO_INACTIVE));
243 #if !defined(OS_MACOSX)
243 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND_INCOGNITO)); 244 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND_INCOGNITO));
245 #endif
244 246
245 // Make sure we don't have phantom data. 247 // Make sure we don't have phantom data.
246 EXPECT_FALSE(pack->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND, 248 EXPECT_FALSE(pack->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND,
247 &color)); 249 &color));
248 EXPECT_FALSE(pack->GetTint(ThemeProperties::TINT_FRAME, &actual)); 250 EXPECT_FALSE(pack->GetTint(ThemeProperties::TINT_FRAME, &actual));
249 } 251 }
250 252
251 void VerifyHiDpiTheme(BrowserThemePack* pack) { 253 void VerifyHiDpiTheme(BrowserThemePack* pack) {
252 // The high DPI theme defines the following images: 254 // The high DPI theme defines the following images:
253 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME)); 255 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME));
254 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INACTIVE)); 256 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INACTIVE));
255 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); 257 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO));
256 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO_INACTIVE)); 258 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO_INACTIVE));
257 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_TOOLBAR)); 259 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_TOOLBAR));
258 260
259 // The high DPI theme does not define the following images: 261 // The high DPI theme does not define the following images:
260 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND)); 262 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND));
261 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND)); 263 #if !defined(OS_MACOSX)
262 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND_INCOGNITO)); 264 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND_INCOGNITO));
265 #endif
263 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND_V)); 266 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND_V));
264 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_NTP_BACKGROUND)); 267 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_NTP_BACKGROUND));
265 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_OVERLAY)); 268 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_OVERLAY));
266 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_OVERLAY_INACTIVE)); 269 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_OVERLAY_INACTIVE));
267 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_BUTTON_BACKGROUND)); 270 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_BUTTON_BACKGROUND));
268 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION)); 271 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_NTP_ATTRIBUTION));
269 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_WINDOW_CONTROL_BACKGROUND)); 272 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_WINDOW_CONTROL_BACKGROUND));
270 273
271 // Compare some known pixel colors at know locations for a theme 274 // Compare some known pixel colors at know locations for a theme
272 // image where two different PNG files were specified for scales 100% 275 // image where two different PNG files were specified for scales 100%
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 } 607 }
605 608
606 // Part 2: Try to read back the data pack that we just wrote to disk. 609 // Part 2: Try to read back the data pack that we just wrote to disk.
607 { 610 {
608 scoped_refptr<BrowserThemePack> pack = 611 scoped_refptr<BrowserThemePack> pack =
609 BrowserThemePack::BuildFromDataPack(file, "gllekhaobjnhgeag"); 612 BrowserThemePack::BuildFromDataPack(file, "gllekhaobjnhgeag");
610 ASSERT_TRUE(pack.get()); 613 ASSERT_TRUE(pack.get());
611 VerifyHiDpiTheme(pack.get()); 614 VerifyHiDpiTheme(pack.get());
612 } 615 }
613 } 616 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698