1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 canvas = document.getElementById("my-canvas");
7 if (canvas.getContext) {
8 context = canvas.getContext("2d");
10 context.fillStyle = 'red';
11 context.fillRect(20, 20, 40, 40);
12 chrome.test.notifyPass();
14 chrome.test.notifyFail("unable to getContext('2d')");
17 chrome.test.notifyFail("canvas.getContext null");
20 chrome.test.notifyFail("couldn't find element my-canvas");