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

Unified Diff: blimp/tools/fake_web/data/square.html

Issue 2626423004: Remove all //blimp code. (Closed)
Patch Set: One last(?) `git merge` for good measure. Created 3 years, 11 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 | « blimp/tools/engine-manifest-blacklist.txt ('k') | blimp/tools/fake_web/server.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: blimp/tools/fake_web/data/square.html
diff --git a/blimp/tools/fake_web/data/square.html b/blimp/tools/fake_web/data/square.html
deleted file mode 100644
index e04d12d581f19eb31c4f5bf19abf8c7e02de35ec..0000000000000000000000000000000000000000
--- a/blimp/tools/fake_web/data/square.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<!doctype html>
-<!--
-
-This page draws a square of random blue pixels whenever the page is clicked
-anywhere. The query string variable "interval" can be specified in milliseconds
-to automatically switch images on an interval, and the variable "size" can
-specify the size of the square in pixels.
-
--->
-
-<script>
-
-var DEFAULT_SQUARE_SIZE = 200;
-
-// Returns an object with a key-value mapping from the query string.
-var parseQuery = function() {
- var pieces = location.search.substring(1).split('&');
- var query = {};
- for (var i = 0; i < pieces.length; i++) {
- var pair = pieces[i].split('=');
- query[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
- }
- return query;
-};
-
-// Draw a square made of random pixels.
-var drawSquare = function(size) {
- var canvas = document.getElementById('square');
- canvas.height = size;
- canvas.width = size;
-
- var context = canvas.getContext('2d');
- for (var x = 0; x < size; x++) {
- for (var y = 0; y < size; y++) {
- var blue = Math.floor(Math.random() * 255);
- context.fillStyle = 'rgb(0, 0, ' + blue + ')';
- context.fillRect(x, y, 1, 1);
- }
- }
-
- // Keep the canvas hidden and write the data URL to an <img> tag, because
- // Blimp doesn't support canvas.
- var image = document.getElementById('square-png');
- image.src = canvas.toDataURL('image/png');
-};
-
-document.addEventListener('DOMContentLoaded', function(event) {
- var query = parseQuery();
- var interval = parseInt(query.interval);
- var size = parseInt(query.size) || DEFAULT_SQUARE_SIZE;
-
- document.addEventListener('click', drawSquare.bind(null, size));
- if (interval) {
- window.setInterval(drawSquare, interval, size);
- }
- drawSquare(size);
-});
-
-</script>
-
-<canvas id="square" style="display:none"></canvas>
-<img id="square-png">
« no previous file with comments | « blimp/tools/engine-manifest-blacklist.txt ('k') | blimp/tools/fake_web/server.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698