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

Unified Diff: chrome/test/data/extensions/platform_apps/windows_api_shape/background.js

Issue 456943004: Fix SetShape (SetAlphaShape) to allow Null regions (+ tests). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing delete; Remove unnecessary layer check" Created 6 years, 4 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
Index: chrome/test/data/extensions/platform_apps/windows_api_shape/background.js
diff --git a/chrome/test/data/extensions/platform_apps/windows_api_shape/background.js b/chrome/test/data/extensions/platform_apps/windows_api_shape/background.js
new file mode 100644
index 0000000000000000000000000000000000000000..d7624d2d7d31d4942e48788750b640ad31beb8a8
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/windows_api_shape/background.js
@@ -0,0 +1,42 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+function testWindowShape(testId, region) {
+ var createOptions = { id: testId, frame: 'none' };
+
+ chrome.app.window.create('index.html',
+ createOptions,
+ chrome.test.callbackPass(function(win) {
+ win.setShape(region)
+ }));
+}
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.test.runTests([
+
+ // Window shape is a single rect.
+ function testWindowShapeSingleRect() {
+ testWindowShape('testWindowShapeSingleRect',
+ {rects: [{left:100, top:50, width:50, height:100}]});
+ },
+
+ // Window shape is multiple rects.
+ function testWindowShapeMultipleRects() {
+ testWindowShape('testWindowShapeMultipleRects',
+ {rects: [{left:100, top:50, width:50, height:100},
+ {left:200, top:100, width:50, height:50}]});
+ },
+
+ // Window shape is null.
+ function testWindowShapeNull() {
+ testWindowShape('testWindowShapeNull', {});
+ },
+
+ // Window shape is empty.
+ function testWindowShapeEmpty() {
+ testWindowShape('testWindowShapeEmpty', {rects: []});
+ },
+
+ ]);
+});

Powered by Google App Engine
This is Rietveld 408576698