Skip to content

Commit

Permalink
add popup test html file to test target=_blank and window.open() popups
Browse files Browse the repository at this point in the history
  • Loading branch information
ataranto committed Jul 18, 2011
1 parent a974e3e commit 03da84a
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CefSharp.Example/Browser.cs
Expand Up @@ -220,7 +220,7 @@ private void testTooltipsToolStripMenuItem_Click(object sender, EventArgs e)

private void testPopupWindowToolStripMenuItem_Click(object sender, EventArgs e)
{
_browserControl.RunScript("window.open('http://www.google.com')", "about:blank", 1, 5000);
_browserControl.Load("test://test/PopupTest.html");
}
}
}
1 change: 1 addition & 0 deletions CefSharp.Example/CefSharp.Example.csproj
Expand Up @@ -127,6 +127,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="Resources\BindingTest.html" />
<None Include="Resources\PopupTest.html" />
<Content Include="Resources\SchemeTest.html" />
<Content Include="Resources\TooltipTest.html" />
</ItemGroup>
Expand Down
18 changes: 18 additions & 0 deletions CefSharp.Example/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions CefSharp.Example/Properties/Resources.resx
Expand Up @@ -142,4 +142,7 @@
<data name="TooltipTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\TooltipTest.html;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
<data name="PopupTest" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\PopupTest.html;System.String, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
</data>
</root>
11 changes: 11 additions & 0 deletions CefSharp.Example/Resources/PopupTest.html
@@ -0,0 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Popup Test</title>
</head>
<body>
<a href="https://github.com/ataranto/CefSharp" target="_blank">target=_blank</a>
<br />
<a href="#" onclick="window.open('https://github.com/ataranto/CefSharp')">window.open()</a>
</body>
</html>
4 changes: 4 additions & 0 deletions CefSharp.Example/TestSchemeHandler.cs
Expand Up @@ -24,6 +24,10 @@ public bool ProcessRequest(IRequest request, ref string mimeType, ref Stream str
{
resource = Resources.TooltipTest;
}
else if (request.Url.EndsWith("PopupTest.html", StringComparison.OrdinalIgnoreCase))
{
resource = Resources.PopupTest;
}

if (!String.IsNullOrEmpty(resource))
{
Expand Down

0 comments on commit 03da84a

Please sign in to comment.