Commit 6c71362f authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Disable the Chrome Light Asset Codepath

In response to user feedback, a dark gray will be used instead of white
as the tile background.

This is the small merge-safe change. A separate change will remote the
light asset pipeline.

BUG=722573,868343

Change-Id: I4aa7a5a5e2ebba3e9068591dd7b5bfc0d3faa6b5
Reviewed-on: https://chromium-review.googlesource.com/1184308
Commit-Queue: Greg Thompson <grt@chromium.org>
Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#584970}
parent 03c9916c
...@@ -302,7 +302,7 @@ std::string GenerateVisualElementsManifest(const base::Version& version, ...@@ -302,7 +302,7 @@ std::string GenerateVisualElementsManifest(const base::Version& version,
light_suffix, elements_dir.c_str(), logo_suffix, light_suffix, light_suffix, elements_dir.c_str(), logo_suffix, light_suffix,
elements_dir.c_str(), logo_suffix, light_suffix, elements_dir.c_str(), logo_suffix, light_suffix,
use_light_assets ? L"dark" : L"light", use_light_assets ? L"dark" : L"light",
use_light_assets ? L"#FFFFFF" : L"#212121")); use_light_assets ? L"#FFFFFF" : L"#5F6368"));
return base::UTF16ToUTF8(manifest16); return base::UTF16ToUTF8(manifest16);
} }
...@@ -328,12 +328,7 @@ VEAssetType DetermineVisualElementAssetType(const base::FilePath& base_path, ...@@ -328,12 +328,7 @@ VEAssetType DetermineVisualElementAssetType(const base::FilePath& base_path,
DCHECK(base::PathExists(visual_elements_dir.Append( DCHECK(base::PathExists(visual_elements_dir.Append(
base::StringPrintf(L"Logo%ls.png", logo_suffix)))); base::StringPrintf(L"Logo%ls.png", logo_suffix))));
// Check for light assets that require dark text. return VEAssetType::kDarkOnly;
base::string16 light_logo_file_name =
base::StringPrintf(L"Logo%lsLight.png", logo_suffix);
return base::PathExists(visual_elements_dir.Append(light_logo_file_name))
? VEAssetType::kDarkAndLight
: VEAssetType::kDarkOnly;
} }
} // namespace } // namespace
......
...@@ -160,18 +160,18 @@ constexpr char kExpectedPrimaryManifest[] = ...@@ -160,18 +160,18 @@ constexpr char kExpectedPrimaryManifest[] =
" Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n"
" Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n" " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n"
" ForegroundText='light'\r\n" " ForegroundText='light'\r\n"
" BackgroundColor='#212121'/>\r\n" " BackgroundColor='#5F6368'/>\r\n"
"</Application>\r\n"; "</Application>\r\n";
constexpr char kExpectedPrimaryLightManifest[] = constexpr char kExpectedPrimaryLightManifest[] =
"<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n"
" <VisualElements\r\n" " <VisualElements\r\n"
" ShowNameOnSquare150x150Logo='on'\r\n" " ShowNameOnSquare150x150Logo='on'\r\n"
" Square150x150Logo='0.0.0.0\\VisualElements\\LogoLight.png'\r\n" " Square150x150Logo='0.0.0.0\\VisualElements\\Logo.png'\r\n"
" Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoLight.png'\r\n" " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n"
" Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoLight.png'\r\n" " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogo.png'\r\n"
" ForegroundText='dark'\r\n" " ForegroundText='light'\r\n"
" BackgroundColor='#FFFFFF'/>\r\n" " BackgroundColor='#5F6368'/>\r\n"
"</Application>\r\n"; "</Application>\r\n";
#if defined(GOOGLE_CHROME_BUILD) #if defined(GOOGLE_CHROME_BUILD)
...@@ -183,20 +183,20 @@ constexpr char kExpectedBetaManifest[] = ...@@ -183,20 +183,20 @@ constexpr char kExpectedBetaManifest[] =
" Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoBeta.png'\r\n" " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoBeta.png'\r\n"
" Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoBeta.png'\r\n" " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoBeta.png'\r\n"
" ForegroundText='light'\r\n" " ForegroundText='light'\r\n"
" BackgroundColor='#212121'/>\r\n" " BackgroundColor='#5F6368'/>\r\n"
"</Application>\r\n"; "</Application>\r\n";
constexpr char kExpectedBetaLightManifest[] = constexpr char kExpectedBetaLightManifest[] =
"<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n"
" <VisualElements\r\n" " <VisualElements\r\n"
" ShowNameOnSquare150x150Logo='on'\r\n" " ShowNameOnSquare150x150Logo='on'\r\n"
" Square150x150Logo='0.0.0.0\\VisualElements\\LogoBetaLight.png'\r\n" " Square150x150Logo='0.0.0.0\\VisualElements\\LogoBeta.png'\r\n"
" " " "
"Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoBetaLight.png'\r\n" "Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoBeta.png'\r\n"
" " " "
"Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoBetaLight.png'\r\n" "Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoBeta.png'\r\n"
" ForegroundText='dark'\r\n" " ForegroundText='light'\r\n"
" BackgroundColor='#FFFFFF'/>\r\n" " BackgroundColor='#5F6368'/>\r\n"
"</Application>\r\n"; "</Application>\r\n";
constexpr char kExpectedDevManifest[] = constexpr char kExpectedDevManifest[] =
...@@ -207,18 +207,18 @@ constexpr char kExpectedDevManifest[] = ...@@ -207,18 +207,18 @@ constexpr char kExpectedDevManifest[] =
" Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoDev.png'\r\n" " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoDev.png'\r\n"
" Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoDev.png'\r\n" " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoDev.png'\r\n"
" ForegroundText='light'\r\n" " ForegroundText='light'\r\n"
" BackgroundColor='#212121'/>\r\n" " BackgroundColor='#5F6368'/>\r\n"
"</Application>\r\n"; "</Application>\r\n";
constexpr char kExpectedDevLightManifest[] = constexpr char kExpectedDevLightManifest[] =
"<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n" "<Application xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>\r\n"
" <VisualElements\r\n" " <VisualElements\r\n"
" ShowNameOnSquare150x150Logo='on'\r\n" " ShowNameOnSquare150x150Logo='on'\r\n"
" Square150x150Logo='0.0.0.0\\VisualElements\\LogoDevLight.png'\r\n" " Square150x150Logo='0.0.0.0\\VisualElements\\LogoDev.png'\r\n"
" Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoDevLight.png'\r\n" " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoDev.png'\r\n"
" Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoDevLight.png'\r\n" " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoDev.png'\r\n"
" ForegroundText='dark'\r\n" " ForegroundText='light'\r\n"
" BackgroundColor='#FFFFFF'/>\r\n" " BackgroundColor='#5F6368'/>\r\n"
"</Application>\r\n"; "</Application>\r\n";
constexpr char kExpectedCanaryManifest[] = constexpr char kExpectedCanaryManifest[] =
...@@ -229,7 +229,7 @@ constexpr char kExpectedCanaryManifest[] = ...@@ -229,7 +229,7 @@ constexpr char kExpectedCanaryManifest[] =
" Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" " Square70x70Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n"
" Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n" " Square44x44Logo='0.0.0.0\\VisualElements\\SmallLogoCanary.png'\r\n"
" ForegroundText='light'\r\n" " ForegroundText='light'\r\n"
" BackgroundColor='#212121'/>\r\n" " BackgroundColor='#5F6368'/>\r\n"
"</Application>\r\n"; "</Application>\r\n";
INSTANTIATE_TEST_CASE_P( INSTANTIATE_TEST_CASE_P(
...@@ -536,24 +536,14 @@ TEST_P(CreateVisualElementsManifestTest, UpdateVisualElementsNoChange) { ...@@ -536,24 +536,14 @@ TEST_P(CreateVisualElementsManifestTest, UpdateVisualElementsNoChange) {
installer::UpdateVisualElementsManifest(test_dir_.GetPath(), version_, installer::UpdateVisualElementsManifest(test_dir_.GetPath(), version_,
!supports_dark_text_); !supports_dark_text_);
// The file should have been modified only if the brand has light assets. // The file should remain using the dark assets.
ASSERT_TRUE(base::GetFileInfo(manifest_path_, &manifest_info_after)); ASSERT_TRUE(base::GetFileInfo(manifest_path_, &manifest_info_after));
if (has_light_assets_) { EXPECT_EQ(manifest_info_before.last_modified,
EXPECT_NE(manifest_info_before.last_modified, manifest_info_after.last_modified);
manifest_info_after.last_modified);
} else {
EXPECT_EQ(manifest_info_before.last_modified,
manifest_info_after.last_modified);
}
ASSERT_TRUE( ASSERT_TRUE(
base::GetFileInfo(start_menu_shortcut_path_, &shortcut_info_after)); base::GetFileInfo(start_menu_shortcut_path_, &shortcut_info_after));
if (has_light_assets_) { EXPECT_EQ(shortcut_info_before.last_modified,
EXPECT_NE(shortcut_info_before.last_modified, shortcut_info_after.last_modified);
shortcut_info_after.last_modified);
} else {
EXPECT_EQ(shortcut_info_before.last_modified,
shortcut_info_after.last_modified);
}
} }
TEST_F(InstallShortcutTest, CreateAllShortcuts) { TEST_F(InstallShortcutTest, CreateAllShortcuts) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment