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

Unified Diff: chrome/android/javatests/src/org/chromium/chrome/browser/widget/PromoDialogTest.java

Issue 2857893003: Replace search_sogou.png with a vector drawable (Closed)
Patch Set: Fix tests Created 3 years, 7 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/android/java/src/org/chromium/chrome/browser/widget/PromoDialogLayout.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/javatests/src/org/chromium/chrome/browser/widget/PromoDialogTest.java
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/widget/PromoDialogTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/widget/PromoDialogTest.java
index d968bea5822b9a8be882af43b02cc79d7b7d2ce8..d64ae5b8218b71b78852a74f438b2cce6e5b74b1 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/widget/PromoDialogTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/widget/PromoDialogTest.java
@@ -102,9 +102,9 @@ public class PromoDialogTest {
public void testBasic_Visibility() throws Exception {
// Create a full dialog.
DialogParams dialogParams = new DialogParams();
- dialogParams.drawableResource = R.drawable.search_sogou;
- dialogParams.headerStringResource = R.string.search_with_sogou;
- dialogParams.subheaderStringResource = R.string.sogou_explanation;
+ dialogParams.drawableResource = R.drawable.data_reduction_illustration;
+ dialogParams.headerStringResource = R.string.data_reduction_promo_title;
+ dialogParams.subheaderStringResource = R.string.data_reduction_promo_summary;
dialogParams.primaryButtonStringResource = R.string.ok;
dialogParams.secondaryButtonStringResource = R.string.cancel;
dialogParams.footerStringResource = R.string.learn_more;
@@ -112,7 +112,7 @@ public class PromoDialogTest {
// Create a minimal dialog.
dialogParams = new DialogParams();
- dialogParams.headerStringResource = R.string.search_with_sogou;
+ dialogParams.headerStringResource = R.string.data_reduction_promo_title;
dialogParams.primaryButtonStringResource = R.string.ok;
checkDialogControlVisibility(dialogParams);
}
@@ -154,9 +154,9 @@ public class PromoDialogTest {
@SmallTest
public void testBasic_Orientation() throws Exception {
DialogParams dialogParams = new DialogParams();
- dialogParams.drawableResource = R.drawable.search_sogou;
- dialogParams.headerStringResource = R.string.search_with_sogou;
- dialogParams.subheaderStringResource = R.string.sogou_explanation;
+ dialogParams.drawableResource = R.drawable.data_reduction_illustration;
+ dialogParams.headerStringResource = R.string.data_reduction_promo_title;
+ dialogParams.subheaderStringResource = R.string.data_reduction_promo_summary;
dialogParams.primaryButtonStringResource = R.string.ok;
dialogParams.secondaryButtonStringResource = R.string.cancel;
dialogParams.footerStringResource = R.string.learn_more;
@@ -253,7 +253,28 @@ public class PromoDialogTest {
// With an illustration, the header View is part of the scrollable content.
{
DialogParams dialogParams = new DialogParams();
- dialogParams.drawableResource = R.drawable.search_sogou;
+ dialogParams.drawableResource = R.drawable.data_reduction_illustration;
+ dialogParams.headerStringResource = R.string.data_reduction_promo_title;
+ dialogParams.primaryButtonStringResource = R.string.data_reduction_enable_button;
+
+ PromoDialogWrapper wrapper = new PromoDialogWrapper(dialogParams);
+ PromoDialogLayout promoDialogLayout =
+ (PromoDialogLayout) wrapper.dialog.getWindow().getDecorView().findViewById(
+ R.id.promo_dialog_layout);
+ ViewGroup scrollableLayout =
+ (ViewGroup) promoDialogLayout.findViewById(R.id.scrollable_promo_content);
+
+ View header = promoDialogLayout.findViewById(R.id.header);
+ MarginLayoutParams headerParams = (MarginLayoutParams) header.getLayoutParams();
+ Assert.assertEquals(scrollableLayout.getChildAt(0), header);
+ Assert.assertEquals(0, ApiCompatibilityUtils.getMarginStart(headerParams));
+ Assert.assertEquals(0, ApiCompatibilityUtils.getMarginEnd(headerParams));
+ }
+
+ // With a vector illustration, the header View is part of the scrollable content.
+ {
+ DialogParams dialogParams = new DialogParams();
+ dialogParams.vectorDrawableResource = R.drawable.search_sogou;
dialogParams.headerStringResource = R.string.search_with_sogou;
dialogParams.primaryButtonStringResource = R.string.ok;
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/widget/PromoDialogLayout.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698