summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-18 21:07:53 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-18 21:07:53 +0000
commit7de487c60478205f8f4396d2b77dd4e0fd65f583 (patch)
treeea02cb62f1edde2791ca2c090dc3eeef55b4e395 /chrome_frame/test
parent3ec54a2fe0482dc97113478ac87e45b505e636be (diff)
downloadchromium_src-7de487c60478205f8f4396d2b77dd4e0fd65f583.zip
chromium_src-7de487c60478205f8f4396d2b77dd4e0fd65f583.tar.gz
chromium_src-7de487c60478205f8f4396d2b77dd4e0fd65f583.tar.bz2
Multiple chrome frame activex controls should instantiate and navigate correctly in IE. This was not
the case due to a race condition between put_src getting called for subsequent activex instances and the external tab to hold the chrome frame instance getting created. Fix is to pass in the URL if we have it when the automation client is initialized to launch the chrome automation server. If not we navigate when the external tab is created. To achieve this we stuff in all relevant parameters into a structure which is populated when the automation client is initialized. I also changed the CreateExternalTab message to carry the referrer for the initial navigation. Fixes http://code.google.com/p/chromium/issues/detail?id=28236 Test=added unit tests for the same. The firefox one is not working at this point. Disabled this test for now while I debug it. Bug=28236 Review URL: http://codereview.chromium.org/500123 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34985 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/chrome_frame_unittests.cc66
-rw-r--r--chrome_frame/test/data/multiple_cf_instances_main.html37
-rw-r--r--chrome_frame/test/data/multiple_cf_instances_test.html22
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>