summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 21:52:46 +0000
committerddorwin@chromium.org <ddorwin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-13 21:52:46 +0000
commitd5e3489faf2ebdc107471b9f36e7603e44208a18 (patch)
tree4084aabbd8645c9732bbb53f3607b050be2d56c0 /ppapi
parent9861e685ff74ba12ee16cd79e72c90842209ae58 (diff)
downloadchromium_src-d5e3489faf2ebdc107471b9f36e7603e44208a18.zip
chromium_src-d5e3489faf2ebdc107471b9f36e7603e44208a18.tar.gz
chromium_src-d5e3489faf2ebdc107471b9f36e7603e44208a18.tar.bz2
Add ability to toggle the size of the plugin.
Useful for exercising DidChangeView() and needed (along with .cc changes) to test bug 64847. BUG=none TEST=none Review URL: http://codereview.chromium.org/6156004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71362 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/example/example.html28
1 files changed, 25 insertions, 3 deletions
diff --git a/ppapi/example/example.html b/ppapi/example/example.html
index f6fdc52..7146b3f 100644
--- a/ppapi/example/example.html
+++ b/ppapi/example/example.html
@@ -1,17 +1,39 @@
<body style="background-image:url(http://www.google.com/intl/en_ALL/images/logo.gif);
- background-repeat:repeat">
+ background-repeat:repeat"
+ onload="SetPluginSize(400, 400)">
<script type="text/javascript">
+isPluginDefaultSize = true;
+
function Test() {
plugin = document.getElementById('plugin');
// Confirm that this no longer segfaults.
alert(plugin.toString(new Array(10)));
}
+function SetPluginSize(width, height) {
+ plugin = document.getElementById('plugin');
+ size = document.getElementById('size');
+ plugin.width = width;
+ plugin.height = height;
+ size.innerHTML = "Height: " + plugin.width + ' Width: ' + plugin.height;
+}
+
+function ToggleSize() {
+ if (!isPluginDefaultSize) {
+ SetPluginSize(400, 400);
+ isPluginDefaultSize = true;
+ } else {
+ SetPluginSize(1000, 800);
+ isPluginDefaultSize = false;
+ }
+}
</script>
<button onclick='Test()'>Test</button>
- <div id="fps" style="background-color:white; font-weight:bold; padding:4px;">FPS GOES HERE</div>
- <object id="plugin" type="application/x-ppapi-example" width="400" height="400" />
+ <button onclick='ToggleSize()'>Toggle Size</button>
+ <div id="fps" style="background-color:white; font-weight:bold; padding:4px; width:200px;">FPS GOES HERE</div>
+ <div id="size" style="background-color:white; font-weight:bold; padding:4px; width:200px;"></div>
+ <object id="plugin" type="application/x-ppapi-example" width="400" height="400" border="2px"></object>
<hr>
</body>