Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Unified Diff: native_client_sdk/src/build_tools/screenshot_extension/README

Issue 23458018: [NaCl SDK] Screen capture extension for use with SDK visual testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix nits Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/screenshot_extension/background.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: native_client_sdk/src/build_tools/screenshot_extension/README
diff --git a/native_client_sdk/src/build_tools/screenshot_extension/README b/native_client_sdk/src/build_tools/screenshot_extension/README
new file mode 100644
index 0000000000000000000000000000000000000000..5c1f505ed3bd38492e71085980f920c220b993e7
--- /dev/null
+++ b/native_client_sdk/src/build_tools/screenshot_extension/README
@@ -0,0 +1,33 @@
+Screenshot Extension
+--------------------
+
+This extension is to visually test the SDK examples. To use, add this to the
+html:
+
+TODO(binji): normal users shouldn't have to do this -- it should be
+automatically loaded by the testing framework.
+
+ <head>
+ ...
+ <script
+ src="chrome-extension://kbbhhngcmjcmlgcnbihfgliliemmijmj/screenshot.js">
+ </script>
+ <head>
+
+Then in JavaScript:
+
+ var myPluginEl = document.embeds[0];
+ function onSuccess(dataURL) {
+ // dataURL is a data URL encoded PNG. You can add this to a image like this:
+ var image = new Image();
+ image.onload = function() { ... }
+ image.src = dataURL;
+ }
+
+ function onError(errorMessage) {
+ ...
+ }
+
+ screenshot.captureElement(myPluginEl, onSuccess, onError);
+
+See screenshot.js for more info on the API.
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/screenshot_extension/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698