summaryrefslogtreecommitdiffstats
path: root/chrome_frame/test
diff options
context:
space:
mode:
authorrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 17:03:41 +0000
committerrogerta@chromium.org <rogerta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-23 17:03:41 +0000
commit00f6b77b89dcd900c873ed9da13dbaa2e90fe022 (patch)
treef8cc2494b35a8cacef56b51c973a1d89548212cd /chrome_frame/test
parent61452e358d496c5e0ac66c7e5f1639dff3c496ac (diff)
downloadchromium_src-00f6b77b89dcd900c873ed9da13dbaa2e90fe022.zip
chromium_src-00f6b77b89dcd900c873ed9da13dbaa2e90fe022.tar.gz
chromium_src-00f6b77b89dcd900c873ed9da13dbaa2e90fe022.tar.bz2
Add bindings to chrome frame to call the new extension automation apis.
TEST=see unit tests BUG=0 Review URL: http://codereview.chromium.org/284017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29902 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test')
-rw-r--r--chrome_frame/test/data/privileged_apis_host.html50
1 files changed, 44 insertions, 6 deletions
diff --git a/chrome_frame/test/data/privileged_apis_host.html b/chrome_frame/test/data/privileged_apis_host.html
index 7261704..fde39e1 100644
--- a/chrome_frame/test/data/privileged_apis_host.html
+++ b/chrome_frame/test/data/privileged_apis_host.html
@@ -25,16 +25,15 @@
onFailure(testName, 1, 'exception in OnChromeFrameMessage');
}
}
-
- function OnChromeFrameLoaded(url) {
+
+ function tryPrivateMessage() {
var cf = GetChromeFrame();
-
+
try {
// Any message received by this listener is a failure.
// This succeeds in FF, but throws an exception in IE.
cf.addEventListener('onprivatemessage', OnPrivateMessage, false);
} catch(e) {
- cf.onprivatemessage =
appendStatus('addEventListener onprivatemessage threw exception')
}
@@ -46,11 +45,50 @@
} catch(e) {
}
appendStatus('After postPrivateMessage')
- // The frame reflects this twice, first to a bogus target
- // and again to the default target '*'. We succeed if we
+ }
+
+ function tryInstallExtension() {
+ var cf = GetChromeFrame();
+
+ try {
+ // Any message received by this listener is a failure.
+ // This succeeds in FF, but throws an exception in IE.
+ cf.installExtension('foo');
+ onFailure(testName, 1, 'installExtension should throw');
+ } catch(e) {
+ appendStatus('installExtension threw exception')
+ }
+
+ appendStatus('After installExtension')
+ }
+
+ function tryLoadExtension() {
+ var cf = GetChromeFrame();
+
+ try {
+ // Any message received by this listener is a failure.
+ // This succeeds in FF, but throws an exception in IE.
+ cf.loadExtension('foo');
+ onFailure(testName, 1, 'loadExtension should throw');
+ } catch(e) {
+ appendStatus('loadExtension threw exception')
+ }
+
+ appendStatus('After loadExtension')
+ }
+
+ function OnChromeFrameLoaded(url) {
+ tryPrivateMessage();
+ tryInstallExtension();
+ tryLoadExtension();
+
+ // The frame reflects this twice, first to a bogus target
+ // and again to the default target '*'. We succeed if we
// get the reflected message to OnChromeFrameMessage and not to
// OnPrivateMessage.
+ var cf = GetChromeFrame();
cf.postMessage('succeed');
+ appendStatus('After cf.postMessage')
}
function GetChromeFrame() {