| 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: []});
|
| + },
|
| +
|
| + ]);
|
| +});
|
|
|