OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 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. |
| 4 |
| 5 function testWindowShape(testId, region) { |
| 6 var createOptions = { id: testId, frame: 'none' }; |
| 7 |
| 8 chrome.app.window.create('index.html', |
| 9 createOptions, |
| 10 chrome.test.callbackPass(function(win) { |
| 11 win.setShape(region) |
| 12 })); |
| 13 } |
| 14 |
| 15 chrome.app.runtime.onLaunched.addListener(function() { |
| 16 chrome.test.runTests([ |
| 17 |
| 18 // Window shape is a single rect. |
| 19 function testWindowShapeSingleRect() { |
| 20 testWindowShape('testWindowShapeSingleRect', |
| 21 {rects: [{left:100, top:50, width:50, height:100}]}); |
| 22 }, |
| 23 |
| 24 // Window shape is multiple rects. |
| 25 function testWindowShapeMultipleRects() { |
| 26 testWindowShape('testWindowShapeMultipleRects', |
| 27 {rects: [{left:100, top:50, width:50, height:100}, |
| 28 {left:200, top:100, width:50, height:50}]}); |
| 29 }, |
| 30 |
| 31 // Window shape is null. |
| 32 function testWindowShapeNull() { |
| 33 testWindowShape('testWindowShapeNull', {}); |
| 34 }, |
| 35 |
| 36 // Window shape is empty. |
| 37 function testWindowShapeEmpty() { |
| 38 testWindowShape('testWindowShapeEmpty', {rects: []}); |
| 39 }, |
| 40 |
| 41 ]); |
| 42 }); |
OLD | NEW |