diff options
Diffstat (limited to 'chrome_frame/test')
-rw-r--r-- | chrome_frame/test/chrome_frame_unittests.cc | 66 | ||||
-rw-r--r-- | chrome_frame/test/data/multiple_cf_instances_main.html | 37 | ||||
-rw-r--r-- | chrome_frame/test/data/multiple_cf_instances_test.html | 22 |
3 files changed, 120 insertions, 5 deletions
diff --git a/chrome_frame/test/chrome_frame_unittests.cc b/chrome_frame/test/chrome_frame_unittests.cc index fc4fd1a..9302105 100644 --- a/chrome_frame/test/chrome_frame_unittests.cc +++ b/chrome_frame/test/chrome_frame_unittests.cc @@ -652,7 +652,16 @@ TEST(ProxyFactoryTest, CreateDestroy) { ProxyFactory f; LaunchDelegateMock d; EXPECT_CALL(d, LaunchComplete(testing::NotNull(), testing::_)).Times(1); - void* id = f.GetAutomationServer(0, L"Adam.N.Epilinter", L"", false, &d); + + ChromeFrameLaunchParams params; + params.automation_server_launch_timeout = 0; + params.profile_name = L"Adam.N.Epilinter"; + params.extra_chrome_arguments = L""; + params.perform_version_check = false; + params.incognito_mode = false; + + void* id = NULL; + f.GetAutomationServer(&d, params, &id); f.ReleaseAutomationServer(id); } @@ -660,8 +669,20 @@ TEST(ProxyFactoryTest, CreateSameProfile) { ProxyFactory f; LaunchDelegateMock d; EXPECT_CALL(d, LaunchComplete(testing::NotNull(), testing::_)).Times(2); - void* i1 = f.GetAutomationServer(0, L"Dr. Gratiano Forbeson", L"", false, &d); - void* i2 = f.GetAutomationServer(0, L"Dr. Gratiano Forbeson", L"", false, &d); + + ChromeFrameLaunchParams params; + params.automation_server_launch_timeout = 0; + params.profile_name = L"Dr. Gratiano Forbeson"; + params.extra_chrome_arguments = L""; + params.perform_version_check = false; + params.incognito_mode = false; + + void* i1 = NULL; + void* i2 = NULL; + + f.GetAutomationServer(&d, params, &i1); + f.GetAutomationServer(&d, params, &i2); + EXPECT_EQ(i1, i2); f.ReleaseAutomationServer(i2); f.ReleaseAutomationServer(i1); @@ -671,8 +692,27 @@ TEST(ProxyFactoryTest, CreateDifferentProfiles) { ProxyFactory f; LaunchDelegateMock d; EXPECT_CALL(d, LaunchComplete(testing::NotNull(), testing::_)).Times(2); - void* i1 = f.GetAutomationServer(0, L"Adam.N.Epilinter", L"", false, &d); - void* i2 = f.GetAutomationServer(0, L"Dr. Gratiano Forbeson", L"", false, &d); + + ChromeFrameLaunchParams params1; + params1.automation_server_launch_timeout = 0; + params1.profile_name = L"Adam.N.Epilinter"; + params1.extra_chrome_arguments = L""; + params1.perform_version_check = false; + params1.incognito_mode = false; + + ChromeFrameLaunchParams params2; + params2.automation_server_launch_timeout = 0; + params2.profile_name = L"Dr. Gratiano Forbeson"; + params2.extra_chrome_arguments = L""; + params2.perform_version_check = false; + params2.incognito_mode = false; + + void* i1 = NULL; + void* i2 = NULL; + + f.GetAutomationServer(&d, params1, &i1); + f.GetAutomationServer(&d, params2, &i2); + EXPECT_NE(i1, i2); f.ReleaseAutomationServer(i2); f.ReleaseAutomationServer(i1); @@ -1667,3 +1707,19 @@ TEST_F(ChromeFrameTestWithWebServer, FullTabModeIE_ChromeFrameXHRTest) { ASSERT_TRUE(CheckResultFile(L"FullTab_XMLHttpRequestTest", "OK")); } +const wchar_t kMultipleCFInstancesTestUrl[] = + L"files/multiple_cf_instances_main.html"; + +TEST_F(ChromeFrameTestWithWebServer, WidgetModeIE_MultipleCFInstances) { + SimpleBrowserTest(IE, kMultipleCFInstancesTestUrl, + L"WidgetMode_MultipleInstancesTest"); +} + +// TODO(ananta) +// Disabled until I figure out why this does not work on Firefox. +TEST_F(ChromeFrameTestWithWebServer, + DISABLED_WidgetModeFF_MultipleCFInstances) { + SimpleBrowserTest(FIREFOX, kMultipleCFInstancesTestUrl, + L"WidgetMode_MultipleInstancesTest"); +} + diff --git a/chrome_frame/test/data/multiple_cf_instances_main.html b/chrome_frame/test/data/multiple_cf_instances_main.html new file mode 100644 index 0000000..da6586d --- /dev/null +++ b/chrome_frame/test/data/multiple_cf_instances_main.html @@ -0,0 +1,37 @@ +<html> +<head> +<title>Multiple chrome frame instances test</title> +<script type="text/javascript"> + function createSecondChromeFrameInstance() { + var dummy = document.createElement('span'); + document.body.appendChild(dummy); + dummy.innerHTML = '<object border="1" width="100%" height ="200px"' + + 'classid="clsid:E0A900DF-9611-4446-86BD-4B1D47E7DB2A">' + + '<param name="src"' + + 'value="multiple_cf_instances_test.html">' + + '<embed id="CFPlugin" width="500" height="500"' + + 'name="ChromeFrame" type="application/chromeframe"' + + 'src="multiple_cf_instances_test.html">' + + '</embed></object>'; + } + + function onLoad() { + createSecondChromeFrameInstance(); + } +</script> +</head> + +<body onload="onLoad();"> + <object id="ChromeFrame1" width="500" height="500" + classid="CLSID:E0A900DF-9611-4446-86BD-4B1D47E7DB2A"> + <param name="src" value="about:blank"> + <embed id="ChromeFramePlugin" width="500" height="500" + name="ChromeFrame" type="application/chromeframe" + src="about:blank"> + </embed> + </object> +ChromeFrame multiple widget instances test page. This testcase verifies +whether multiple chrome frame widget instances can be created on the +same page. +</body> +</html> diff --git a/chrome_frame/test/data/multiple_cf_instances_test.html b/chrome_frame/test/data/multiple_cf_instances_test.html new file mode 100644 index 0000000..3208802 --- /dev/null +++ b/chrome_frame/test/data/multiple_cf_instances_test.html @@ -0,0 +1,22 @@ +<html> + <head> + <title>Multiple ChromeFrame instances target page.</title> + <script type="text/javascript" + src="chrome_frame_tester_helpers.js"></script> + + <script type="text/javascript"> + function onLoad() { + if (!isRunningInChrome()) { + onFailure("WidgetMode_MultipleInstancesTest", 1, + "Page not running in Chrome"); + } else { + onSuccess("WidgetMode_MultipleInstancesTest", 1); + } + } + </script> + </head> + + <body onLoad="onLoad()"> + ChromeFrame multiple widget instances test + </body> +</html> |