OLD | NEW |
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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 // they're included in the theme pack, they were autogenerated and | 241 // they're included in the theme pack, they were autogenerated and |
242 // therefore shouldn't show up when calling HasCustomImage(). | 242 // therefore shouldn't show up when calling HasCustomImage(). |
243 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INACTIVE)); | 243 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INACTIVE)); |
244 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); | 244 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); |
245 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO_INACTIVE)); | 245 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO_INACTIVE)); |
246 #if !defined(OS_MACOSX) | 246 #if !defined(OS_MACOSX) |
247 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND_INCOGNITO)); | 247 EXPECT_FALSE(pack->HasCustomImage(IDR_THEME_TAB_BACKGROUND_INCOGNITO)); |
248 #endif | 248 #endif |
249 | 249 |
250 // Make sure we don't have phantom data. | 250 // Make sure we don't have phantom data. |
251 EXPECT_FALSE(pack->GetColor(ThemeProperties::COLOR_CONTROL_BACKGROUND, | |
252 &color)); | |
253 EXPECT_FALSE(pack->GetTint(ThemeProperties::TINT_FRAME, &actual)); | 251 EXPECT_FALSE(pack->GetTint(ThemeProperties::TINT_FRAME, &actual)); |
254 } | 252 } |
255 | 253 |
256 void VerifyHiDpiTheme(BrowserThemePack* pack) { | 254 void VerifyHiDpiTheme(BrowserThemePack* pack) { |
257 // The high DPI theme defines the following images: | 255 // The high DPI theme defines the following images: |
258 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME)); | 256 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME)); |
259 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INACTIVE)); | 257 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INACTIVE)); |
260 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); | 258 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO)); |
261 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO_INACTIVE)); | 259 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_FRAME_INCOGNITO_INACTIVE)); |
262 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_TOOLBAR)); | 260 EXPECT_TRUE(pack->HasCustomImage(IDR_THEME_TOOLBAR)); |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
650 } | 648 } |
651 | 649 |
652 // Part 2: Try to read back the data pack that we just wrote to disk. | 650 // Part 2: Try to read back the data pack that we just wrote to disk. |
653 { | 651 { |
654 scoped_refptr<BrowserThemePack> pack = | 652 scoped_refptr<BrowserThemePack> pack = |
655 BrowserThemePack::BuildFromDataPack(file, "gllekhaobjnhgeag"); | 653 BrowserThemePack::BuildFromDataPack(file, "gllekhaobjnhgeag"); |
656 ASSERT_TRUE(pack.get()); | 654 ASSERT_TRUE(pack.get()); |
657 VerifyHiDpiTheme(pack.get()); | 655 VerifyHiDpiTheme(pack.get()); |
658 } | 656 } |
659 } | 657 } |
OLD | NEW |