commit | 7b21928f5f302e7481f17823165fc157f46ca2a2 | [log] [tgz] |
---|---|---|
author | Jerome Gaillard <jgaillard@google.com> | Fri Mar 06 15:16:14 2020 +0000 |
committer | Jerome Gaillard <jgaillard@google.com> | Tue Mar 10 18:43:19 2020 +0000 |
tree | c50824351cce658210babbf199aa79596939a174 | |
parent | bef73f73467041b1d4b7cad958fc996375c3f383 [diff] |
Use different golden images for linux and macOs tests There are some small differences between linux and macOs renderings. Bug: 148525019 Test: layoutlib tests on macOs Change-Id: I8fe38fc238f7011467b5acbe8b28bb1e81c0ade3 (cherry picked from commit 30b9f0d4ce2240eb47815c4c49580fe6d69c3eb3)
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/activity.png b/bridge/tests/res/testApp/MyApplication/golden-mac/activity.png new file mode 100644 index 0000000..a87768c --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/activity.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon.png b/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon.png new file mode 100644 index 0000000..741ddd7 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_circle.png b/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_circle.png new file mode 100644 index 0000000..772c6e0 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_circle.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_rounded_corners.png b/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_rounded_corners.png new file mode 100644 index 0000000..792c2fb --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_rounded_corners.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_squircle.png b/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_squircle.png new file mode 100644 index 0000000..625a37d --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/adaptive_icon_squircle.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/allwidgets.png b/bridge/tests/res/testApp/MyApplication/golden-mac/allwidgets.png new file mode 100644 index 0000000..2168a94 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/allwidgets.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/allwidgets_tab.png b/bridge/tests/res/testApp/MyApplication/golden-mac/allwidgets_tab.png new file mode 100644 index 0000000..2876c3f --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/allwidgets_tab.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/animated_vector.png b/bridge/tests/res/testApp/MyApplication/golden-mac/animated_vector.png new file mode 100644 index 0000000..dab02bb --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/animated_vector.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/animated_vector_1.png b/bridge/tests/res/testApp/MyApplication/golden-mac/animated_vector_1.png new file mode 100644 index 0000000..dbc2637 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/animated_vector_1.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/array_check.png b/bridge/tests/res/testApp/MyApplication/golden-mac/array_check.png new file mode 100644 index 0000000..08dca48 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/array_check.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/asset.png b/bridge/tests/res/testApp/MyApplication/golden-mac/asset.png new file mode 100644 index 0000000..1a31532 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/asset.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/auto-scale-image.png b/bridge/tests/res/testApp/MyApplication/golden-mac/auto-scale-image.png new file mode 100644 index 0000000..e5ed97d --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/auto-scale-image.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/canvas.png b/bridge/tests/res/testApp/MyApplication/golden-mac/canvas.png new file mode 100644 index 0000000..1b30fc3 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/canvas.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/color_interpolation.png b/bridge/tests/res/testApp/MyApplication/golden-mac/color_interpolation.png new file mode 100644 index 0000000..c1790b3 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/color_interpolation.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/context_theme_wrapper.png b/bridge/tests/res/testApp/MyApplication/golden-mac/context_theme_wrapper.png new file mode 100644 index 0000000..5627108 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/context_theme_wrapper.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/expand_horz_layout.png b/bridge/tests/res/testApp/MyApplication/golden-mac/expand_horz_layout.png new file mode 100644 index 0000000..0ae96a5 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/expand_horz_layout.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/expand_vert_layout.png b/bridge/tests/res/testApp/MyApplication/golden-mac/expand_vert_layout.png new file mode 100644 index 0000000..2f0b937 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/expand_vert_layout.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/font_test.png b/bridge/tests/res/testApp/MyApplication/golden-mac/font_test.png new file mode 100644 index 0000000..cd33664 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/font_test.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners.png b/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners.png new file mode 100644 index 0000000..a048d3e --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners_translucent.png b/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners_translucent.png new file mode 100644 index 0000000..d5922f9 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners_translucent.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners_translucent_land.png b/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners_translucent_land.png new file mode 100644 index 0000000..5a8e890 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/four_corners_translucent_land.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/gradient_alpha_drawable.png b/bridge/tests/res/testApp/MyApplication/golden-mac/gradient_alpha_drawable.png new file mode 100644 index 0000000..1af6993 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/gradient_alpha_drawable.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/gradient_colors.png b/bridge/tests/res/testApp/MyApplication/golden-mac/gradient_colors.png new file mode 100644 index 0000000..4fe1e28 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/gradient_colors.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/justified_inter_word.png b/bridge/tests/res/testApp/MyApplication/golden-mac/justified_inter_word.png new file mode 100644 index 0000000..6b48670 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/justified_inter_word.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/justified_none.png b/bridge/tests/res/testApp/MyApplication/golden-mac/justified_none.png new file mode 100644 index 0000000..e071ce6 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/justified_none.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/large_shadows_test_high_quality.png b/bridge/tests/res/testApp/MyApplication/golden-mac/large_shadows_test_high_quality.png new file mode 100644 index 0000000..d72e2f9 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/large_shadows_test_high_quality.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/many_line_breaks.png b/bridge/tests/res/testApp/MyApplication/golden-mac/many_line_breaks.png new file mode 100644 index 0000000..6c7a53b --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/many_line_breaks.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/ninepatch_background.png b/bridge/tests/res/testApp/MyApplication/golden-mac/ninepatch_background.png new file mode 100644 index 0000000..a7b3fe1 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/ninepatch_background.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/ninepatch_drawable.png b/bridge/tests/res/testApp/MyApplication/golden-mac/ninepatch_drawable.png new file mode 100644 index 0000000..733d19b --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/ninepatch_drawable.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/normal_layout.png b/bridge/tests/res/testApp/MyApplication/golden-mac/normal_layout.png new file mode 100644 index 0000000..f1d406e --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/normal_layout.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/ondraw_crash.png b/bridge/tests/res/testApp/MyApplication/golden-mac/ondraw_crash.png new file mode 100644 index 0000000..79aa3a8 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/ondraw_crash.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/onmeasure_crash.png b/bridge/tests/res/testApp/MyApplication/golden-mac/onmeasure_crash.png new file mode 100644 index 0000000..bac8f8e --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/onmeasure_crash.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/rtl_ltr.png b/bridge/tests/res/testApp/MyApplication/golden-mac/rtl_ltr.png new file mode 100644 index 0000000..ce0d0c5 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/rtl_ltr.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/scrolled.png b/bridge/tests/res/testApp/MyApplication/golden-mac/scrolled.png new file mode 100644 index 0000000..27227ea --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/scrolled.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/shadow_scrollview_test_high_quality.png b/bridge/tests/res/testApp/MyApplication/golden-mac/shadow_scrollview_test_high_quality.png new file mode 100644 index 0000000..b07fd93 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/shadow_scrollview_test_high_quality.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/shadow_sizes_test_high_quality.png b/bridge/tests/res/testApp/MyApplication/golden-mac/shadow_sizes_test_high_quality.png new file mode 100644 index 0000000..8358fbb --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/shadow_sizes_test_high_quality.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test.png b/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test.png new file mode 100644 index 0000000..b42d68f --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_high_quality.png b/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_high_quality.png new file mode 100644 index 0000000..b42d68f --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_high_quality.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_high_quality_rounded_edge.png b/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_high_quality_rounded_edge.png new file mode 100644 index 0000000..d732340 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_high_quality_rounded_edge.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_no_shadow.png b/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_no_shadow.png new file mode 100644 index 0000000..b42d68f --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/shadows_test_no_shadow.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/shrunk_layout.png b/bridge/tests/res/testApp/MyApplication/golden-mac/shrunk_layout.png new file mode 100644 index 0000000..fe6fc16 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/shrunk_layout.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity-old-theme.png b/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity-old-theme.png new file mode 100644 index 0000000..7419f5b --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity-old-theme.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity.png b/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity.png new file mode 100644 index 0000000..afa22c5 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity_noactionbar.png b/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity_noactionbar.png new file mode 100644 index 0000000..f9a8dff --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/simple_activity_noactionbar.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/translate_test.png b/bridge/tests/res/testApp/MyApplication/golden-mac/translate_test.png new file mode 100644 index 0000000..4f29163 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/translate_test.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/typed_arrays.png b/bridge/tests/res/testApp/MyApplication/golden-mac/typed_arrays.png new file mode 100644 index 0000000..f35e333 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/typed_arrays.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable.png b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable.png new file mode 100644 index 0000000..b944289 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_91383.png b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_91383.png new file mode 100644 index 0000000..d5fad4c --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_91383.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_gradient.png b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_gradient.png new file mode 100644 index 0000000..4b886e7 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_gradient.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_radial_gradient.png b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_radial_gradient.png new file mode 100644 index 0000000..f478643 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_radial_gradient.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_with_tint_in_image_view.png b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_with_tint_in_image_view.png new file mode 100644 index 0000000..75b59e5 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_with_tint_in_image_view.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_with_tint_itself.png b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_with_tint_itself.png new file mode 100644 index 0000000..0000587 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/vector_drawable_with_tint_itself.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/view_boundaries.png b/bridge/tests/res/testApp/MyApplication/golden-mac/view_boundaries.png new file mode 100644 index 0000000..767bcbb --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/view_boundaries.png Binary files differ
diff --git a/bridge/tests/res/testApp/MyApplication/golden-mac/view_stub.png b/bridge/tests/res/testApp/MyApplication/golden-mac/view_stub.png new file mode 100644 index 0000000..04f4588 --- /dev/null +++ b/bridge/tests/res/testApp/MyApplication/golden-mac/view_stub.png Binary files differ
diff --git a/bridge/tests/src/com/android/layoutlib/bridge/intensive/RenderTestBase.java b/bridge/tests/src/com/android/layoutlib/bridge/intensive/RenderTestBase.java index b18a69a..704929e 100644 --- a/bridge/tests/src/com/android/layoutlib/bridge/intensive/RenderTestBase.java +++ b/bridge/tests/src/com/android/layoutlib/bridge/intensive/RenderTestBase.java
@@ -54,6 +54,7 @@ import java.net.URL; import java.util.ArrayList; import java.util.Arrays; +import java.util.Locale; import java.util.concurrent.TimeUnit; import com.google.android.collect.Lists; @@ -413,7 +414,14 @@ */ protected static void verify(@NonNull String goldenImageName, @NonNull BufferedImage image) { try { - String goldenImagePath = APP_TEST_DIR + "/golden/" + goldenImageName; + boolean isMac = System.getProperty("os.name").toLowerCase(Locale.US).contains("mac"); + String goldenImagePath = APP_TEST_DIR; + if (isMac) { + goldenImagePath += "/golden-mac/"; + } else { + goldenImagePath += "/golden/"; + } + goldenImagePath += goldenImageName; ImageUtils.requireSimilar(goldenImagePath, image); } catch (IOException e) { getLogger().error(e, e.getMessage());