Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/xwt.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJérémie Laval <jeremie.laval@gmail.com>2013-11-22 02:21:28 +0400
committerJérémie Laval <jeremie.laval@gmail.com>2013-11-22 02:21:28 +0400
commitd9d88153637c123554a1378e4665ef6edf99be54 (patch)
treeec3741d840db9c26b171842b4aec663b3f3122a2 /Testing
parent5c770838900d35ffdd5492f1e8508fe6b366caad (diff)
[BackendHost] When setting a custom backend, call OnBackendCreated to let normal processing happen.
This fixes NativeWindowFrame screen bounds property.
Diffstat (limited to 'Testing')
-rw-r--r--Testing/GtkTestRunner.csproj4
-rw-r--r--Testing/Tests/GtkIntegrationTests.cs43
2 files changed, 47 insertions, 0 deletions
diff --git a/Testing/GtkTestRunner.csproj b/Testing/GtkTestRunner.csproj
index a7233e20..4b05ca97 100644
--- a/Testing/GtkTestRunner.csproj
+++ b/Testing/GtkTestRunner.csproj
@@ -56,6 +56,9 @@
<HintPath>libs\nunit.util.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
+ <Reference Include="atk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f">
+ <Private>False</Private>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="GtkTestRunner\Main.cs" />
@@ -109,6 +112,7 @@
<Compile Include="Tests\InternalChildrenTests.cs" />
<Compile Include="Tests\LinkLabelTests.cs" />
<Compile Include="Tests\FormattedTextTests.cs" />
+ <Compile Include="Tests\GtkIntegrationTests.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>
diff --git a/Testing/Tests/GtkIntegrationTests.cs b/Testing/Tests/GtkIntegrationTests.cs
new file mode 100644
index 00000000..600eac6d
--- /dev/null
+++ b/Testing/Tests/GtkIntegrationTests.cs
@@ -0,0 +1,43 @@
+using System;
+using NUnit.Framework;
+
+namespace Xwt
+{
+ public class GtkIntegrationTests : XwtTest
+ {
+ [Test]
+ public void NativeWindowFrameHasCorrectScreenBounds ()
+ {
+ var nativeWindow = new Gtk.Window ("Foo");
+ nativeWindow.Resize (450, 320);
+ nativeWindow.Move (13, 50);
+ nativeWindow.ShowAll ();
+
+ WaitForEvents ();
+
+ var window = Toolkit.CurrentEngine.WrapWindow (nativeWindow);
+ var bounds = window.ScreenBounds;
+ Assert.AreEqual (450, bounds.Width);
+ Assert.AreEqual (320, bounds.Height);
+ Assert.AreEqual (13, bounds.X);
+ Assert.AreEqual (50, bounds.Y);
+
+ nativeWindow.Move (30, 100);
+ WaitForEvents ();
+ bounds = window.ScreenBounds;
+ Assert.AreEqual (30, bounds.X);
+ Assert.AreEqual (100, bounds.Y);
+ Assert.AreEqual (450, bounds.Width);
+ Assert.AreEqual (320, bounds.Height);
+
+ nativeWindow.Resize (100, 100);
+ WaitForEvents ();
+ bounds = window.ScreenBounds;
+ Assert.AreEqual (30, bounds.X);
+ Assert.AreEqual (100, bounds.Y);
+ Assert.AreEqual (100, bounds.Width);
+ Assert.AreEqual (100, bounds.Height);
+ }
+ }
+}
+