Add TC for IsOpaque(evas_object_image_alpha_set) 22/153422/2
authorSeungkeun Lee <sngn.lee@samsung.com>
Thu, 28 Sep 2017 10:00:14 +0000 (19:00 +0900)
committerSeungkeun Lee <sngn.lee@samsung.com>
Thu, 28 Sep 2017 10:02:33 +0000 (19:02 +0900)
Change-Id: I8e0b055cac14ebe7799d6c0f6294ce8cb0104ca9

test/ElmSharp.Test/TC/ImageTest5.cs [new file with mode: 0644]
test/ElmSharp.Test/res/img_1_a.png [new file with mode: 0644]
test/ElmSharp.Test/res/img_2_a.png [new file with mode: 0644]

diff --git a/test/ElmSharp.Test/TC/ImageTest5.cs b/test/ElmSharp.Test/TC/ImageTest5.cs
new file mode 100644 (file)
index 0000000..a07635f
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.IO;
+using ElmSharp;
+using System.Collections.Generic;
+using System.Threading.Tasks;
+
+namespace ElmSharp.Test
+{
+    public class ImageTest5 : TestCaseBase
+    {
+        public override string TestName => "ImageTest5";
+        public override string TestDescription => "TC of IsOpaque";
+
+        Image image;
+        Label lbInfo;
+
+        public override void Run(Window window)
+        {
+            Conformant conformant = new Conformant(window);
+            conformant.Show();
+            Box box = new Box(window);
+            conformant.SetContent(box);
+            box.Show();
+
+            image = new Image(window)
+            {
+                IsFixedAspect = true,
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            image.Show();
+
+            Button kill = new Button(window)
+            {
+                Text = "Kill",
+                AlignmentX = -1,
+                AlignmentY = -1,
+                WeightX = 1,
+                WeightY = 1
+            };
+            kill.Show();
+
+            kill.Clicked += async (s, e) =>
+            {
+                image.LoadAsync(Path.Combine(TestRunner.ResourceDir, "img_1_a.png"));
+                await Task.Delay(10);
+                await image.LoadAsync(Path.Combine(TestRunner.ResourceDir, "img_2_a.png"));
+                image.IsOpaque = false;
+            };
+
+            box.PackEnd(image);
+            box.PackEnd(kill);
+        }
+    }
+}
diff --git a/test/ElmSharp.Test/res/img_1_a.png b/test/ElmSharp.Test/res/img_1_a.png
new file mode 100644 (file)
index 0000000..0e57207
Binary files /dev/null and b/test/ElmSharp.Test/res/img_1_a.png differ
diff --git a/test/ElmSharp.Test/res/img_2_a.png b/test/ElmSharp.Test/res/img_2_a.png
new file mode 100644 (file)
index 0000000..4081fc8
Binary files /dev/null and b/test/ElmSharp.Test/res/img_2_a.png differ