Browse files

Added more object marshalling test stuff

Signed-off-by: Peter Nelson <peter@peterdn.com>
  • Loading branch information...
1 parent 7993ce9 commit d31977d1fd0aac98865f6f374d6273065b56940a @peterdn peterdn committed Sep 23, 2010
Showing with 13 additions and 3 deletions.
  1. +13 −3 WebKitBrowserTest/MainForm.cs
View
16 WebKitBrowserTest/MainForm.cs
@@ -288,6 +288,9 @@ private void jSTestPageToolStripMenuItem_Click(object sender, EventArgs e)
}
function testtest(dog) {
alert(dog.test.x);
+ dog.test.y = ""TESTSTRING"";
+ dog.test.i = 42.55;
+ dog.test.b = true;
}
</script>
</head>
@@ -306,21 +309,28 @@ private void test3ToolStripMenuItem_Click(object sender, EventArgs e)
{
if (dog.HasProperty("breed"))
{
- MessageBox.Show("breed = " + dog.GetProperty("breed").ToString());
+ /*MessageBox.Show("breed = " + dog.GetProperty("breed").ToString());
dog.SetProperty("breed", "Border Collie");
MessageBox.Show("breed = " + dog.GetProperty("breed").ToString());
dog.SetProperty("name", "Holly");
- MessageBox.Show("name = " + dog.GetProperty("name").ToString());
+ MessageBox.Show("name = " + dog.GetProperty("name").ToString());*/
ctx.EvaluateScript("printDog(myDog)");
- dog.SetProperty("test", new TestClass());
+ TestClass myTest = new TestClass() { x = "testing" };
+ dog.SetProperty("test", myTest);
ctx.EvaluateScript("testtest(myDog)");
//ctx.GarbageCollect();
+
+ MessageBox.Show(String.Format("y = {0}, i = {1}, b = {2}", myTest.y, myTest.i, myTest.b));
}
}
}
private class TestClass
{
+ public string x { get; set; }
+ public string y { get; set; }
+ public double i { get; set; }
+ public bool b { get; set; }
}
}
}

0 comments on commit d31977d

Please sign in to comment.